home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Advanced_T211908712008.psc / Advanced Task Manager / Button.ctl
Text File  |  2007-10-29  |  159KB  |  2,856 lines

  1. VERSION 5.00
  2. Begin VB.UserControl Button 
  3.    ClientHeight    =   3600
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   4800
  7.    ScaleHeight     =   3600
  8.    ScaleWidth      =   4800
  9. End
  10. Attribute VB_Name = "Button"
  11. Attribute VB_GlobalNameSpace = False
  12. Attribute VB_Creatable = True
  13. Attribute VB_PredeclaredId = False
  14. Attribute VB_Exposed = False
  15. Option Explicit
  16. '''''''''''''''''''''''''''''''''''''''''''''''''''''
  17. ' ************************************************* '
  18. ' *                                               * '
  19. ' *  Control Name:   ShapeButton                  * '
  20. ' *                                               * '
  21. ' *  Created:        10/September/2007            * '
  22. ' *                                               * '
  23. ' *  Created by:       Ahmed Alotiabe             * '
  24. ' *                                               * '
  25. ' *  You Have A Royalty Free Right To Use         * '
  26. ' *  Modify And Reproduce And Distribute.         * '
  27. ' *                                               * '
  28. ' *  But I Assume No Warranty, Obligations        * '
  29. ' *  Or Liability For The Use Of This Code.       * '
  30. ' *                                               * '
  31. ' *   For Any Damage This Control                 * '
  32. ' *           Can Cause To Your Products.         * '
  33. ' ************************************************* '
  34. '''''''''''''''''''''''''''''''''''''''''''''''''''''
  35.  
  36. '>> Needed For The API Call >> GradientFill >> Backgraound
  37. Private Type GRADIENT_RECT
  38.     UpperLeft            As Long
  39.     LowerRight           As Long
  40. End Type
  41.  
  42. Private Type TRIVERTEX
  43.     X                    As Long
  44.     Y                    As Long
  45.     Red                  As Integer
  46.     Green                As Integer
  47.     Blue                 As Integer
  48.     Alpha                As Integer
  49. End Type
  50. '............................................................
  51. '>>Needed For The API Call >> CreatePolygonRgn >> Polygon
  52. '>>Postion For Picture And Caption ...etc.
  53. Private Type POINTAPI
  54.     X                    As Long
  55.     Y                    As Long
  56. End Type
  57. '............................................................
  58. '>> Constant Types Used With CreatePolygonRgn
  59. Private Const WINDING    As Long = 2
  60.  
  61. '............................................................
  62. '>> Constant Types Used With GradientFill
  63. Private Const GRADIENT_FILL_RECT_H As Long = &H0
  64. Private Const GRADIENT_FILL_RECT_V As Long = &H1
  65.  
  66. '............................................................
  67. '>> Constant Types For LinsStyle
  68. Private Const BDR_VISUAL As Long = vb3DDKShadow
  69. Private Const BDR_VISUAL1 As Long = vbButtonShadow
  70. Private Const BDR_VISUAL2 As Long = vb3DHighlight
  71.  
  72. '............................................................
  73. '>> Constant Types For LinsStyle
  74. Private Const BDR_FLAT1  As Long = vb3DDKShadow
  75. Private Const BDR_FLAT2  As Long = vb3DHighlight
  76.  
  77. '............................................................
  78. '>> Constant Types For LinsStyle
  79. Private Const BDR_JAVA1  As Long = vbButtonShadow
  80. Private Const BDR_JAVA2  As Long = vb3DHighlight
  81.  
  82. '............................................................
  83. '>> Constant Values For White Border >> IF Mouse Down Button
  84. Private Const BDR_PRESSED As Long = vb3DHighlight
  85.  
  86. '............................................................
  87. '>> Constant Values For Gold Border >> IF Mouse Over Button
  88. Private Const BDR_GOLDXP_DARK As Long = &H109ADC
  89. Private Const BDR_GOLDXP_NORMAL1 As Long = &H31B2F0
  90. Private Const BDR_GOLDXP_NORMAL2 As Long = &H90D6F7
  91. Private Const BDR_GOLDXP_LIGHT1 As Long = &HCEF3FF
  92. Private Const BDR_GOLDXP_LIGHT2 As Long = &H8CDBFF
  93.  
  94. '............................................................
  95. '>> Constant Types For LinsStyle
  96. Private Const BDR_VISTA1 As Long = vbWhite
  97. Private Const BDR_VISTA2 As Long = &HCFB073
  98.  
  99. '............................................................
  100. '>> Constant Types For FocusRect
  101. '>> If Display Properties Colors IS Hight Color(16Bit)Use
  102. 'Private Const BDR_FOCUSRECT As Long = &HC0C0C0    '>> Color Gray
  103.  
  104. '>> If Display Properties Colors IS TrueColor(32Bit)Use
  105. Private Const BDR_FOCUSRECT As Long = &HD1D1D1             '>> Color LightGray
  106. '>> Constant Types For FocusRect Java
  107. Private Const BDR_FOCUSRECT_JAVA As Long = &HCC9999        '>> ColorMauve
  108. '>> Constant Values For FocusRect Vista
  109. Private Const BDR_FOCUSRECT_VISTA As Long = 16698372
  110. '>> Constant Values For FocusRect Xp
  111. Private Const BDR_BLUEXP_DARK As Long = &HD98D59
  112. Private Const BDR_BLUEXP_NORMAL1 As Long = &HE2A981
  113. Private Const BDR_BLUEXP_NORMAL2 As Long = &HF0D1B5
  114. Private Const BDR_BLUEXP_LIGHT1 As Long = &HF7D7BD
  115. Private Const BDR_BLUEXP_LIGHT2 As Long = &HFFE7CE
  116.  
  117. '............................................................
  118. '>> Constant Types For HandPointer
  119. Private Const CURSOR_HAND = 32649&
  120.  
  121. '............................................................
  122. '>> API Declare Function's
  123. Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
  124. Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
  125. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  126. Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
  127. Private Declare Function GetCapture& Lib "user32" ()
  128. Private Declare Function SetCapture& Lib "user32" (ByVal hWnd&)
  129. Private Declare Function ReleaseCapture& Lib "user32" ()
  130. Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  131. Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
  132. Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As POINTAPI) As Long
  133. Private Declare Function TextOutW Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  134. Private Declare Function TextOutA Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  135. Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, lpPoint As POINTAPI) As Long
  136. Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  137. Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
  138. Private Declare Function GradientFill Lib "msimg32" (ByVal hdc As Long, ByRef pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As Any, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Integer
  139. Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, ByVal palet As Long, Col As Long) As Long
  140. Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
  141. Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
  142. Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
  143. Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  144. Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
  145. Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
  146. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  147.  
  148. '............................................................
  149. '>> Button Declarations
  150. '............................................................
  151. Public Enum EnumButtonShape
  152.     Rectangle
  153.     RoundedRectangle
  154.     Round
  155.     Diamond
  156.     Top_Triangle
  157.     Left_Triangle
  158.     Right_Triangle
  159.     Down_Triangle
  160.     top_Arrow
  161.     Left_Arrow
  162.     Right_Arrow
  163.     Down_Arrow
  164. End Enum
  165. Public Enum EnumButtonStyle
  166.     Custom
  167.     Visual
  168.     Flat
  169.     OverFlat
  170.     Java
  171.     XPOffice
  172.     WinXp
  173.     Vista
  174.     Glass
  175. End Enum
  176. Public Enum EnumButtonStyleColors
  177.     Transparent
  178.     SingleColor
  179.     Gradient_H
  180.     Gradient_V
  181.     TubeCenter_H
  182.     TubeTopBottom_H
  183.     TubeCenter_V
  184.     TubeTopBottom_V
  185. End Enum
  186. Public Enum EnumButtonTheme
  187.     NoTheme
  188.     XpBlue
  189.     XpOlive
  190.     XPSilver
  191.     Visual2005
  192.     Norton2005
  193.     RedColor
  194.     GreenColor
  195.     BlueColor
  196. End Enum
  197. Public Enum EnumButtonType
  198.     Button
  199.     CheckBox
  200. End Enum
  201. Public Enum EnumCaptionAlignment
  202.     TopCaption
  203.     LeftCaption
  204.     CenterCaption
  205.     RightCaption
  206.     BottomCaption
  207. End Enum
  208. Public Enum EnumCaptionEffect
  209.     Default
  210.     Raised
  211.     Sunken
  212.     Outline
  213. End Enum
  214. Public Enum EnumCaptionStyle
  215.     Normal
  216.     HorizontalFill
  217.     VerticalFill
  218. End Enum
  219. Public Enum EnumDropDown
  220.     None
  221.     LeftDropDown
  222.     RightDropDown
  223. End Enum
  224. Public Enum EnumPictureAlignment
  225.     TopPicture
  226.     LeftPicture
  227.     CenterPicture
  228.     RightPicture
  229.     BottomPicture
  230. End Enum
  231. '............................................................
  232. '>> Property Member Variables
  233. '............................................................
  234. Private mButtonShape     As EnumButtonShape
  235. Private mButtonStyle     As EnumButtonStyle
  236. Private mButtonStyleColors As EnumButtonStyleColors
  237. Private mButtonTheme     As EnumButtonTheme
  238. Private mButtonType      As EnumButtonType
  239. Private mCaptionAlignment As EnumCaptionAlignment
  240. Private mCaptionEffect   As EnumCaptionEffect
  241. Private mCaptionStyle    As EnumCaptionStyle
  242. Private mDropDown        As EnumDropDown
  243. Private mPictureAlignment As EnumPictureAlignment
  244.  
  245. '............................................................
  246. '>> Property Color Variables
  247. Dim mBackColor           As OLE_COLOR
  248. Dim mBackColorPressed    As OLE_COLOR
  249. Dim mBackColorHover      As OLE_COLOR
  250. '............................................................
  251. Dim mBorderColor         As OLE_COLOR
  252. Dim mBorderColorPressed  As OLE_COLOR
  253. Dim mBorderColorHover    As OLE_COLOR
  254. '............................................................
  255. Dim mForeColor           As OLE_COLOR
  256. Dim mForeColorPressed    As OLE_COLOR
  257. Dim mForeColorHover      As OLE_COLOR
  258. '............................................................
  259. Dim mEffectColor         As OLE_COLOR
  260.  
  261. Dim mCaption             As String
  262. Dim mFocusRect           As Boolean
  263. Dim mFocused             As Boolean
  264. Dim mValue               As Boolean
  265. Dim mHandPointer         As Boolean
  266. Dim mPicture             As Picture
  267. Dim mPictureGray         As Boolean
  268. '............................................................
  269. Dim CaptionPos(1)        As POINTAPI                          '>> Postion Text
  270. Dim PicturePos(1)        As POINTAPI                          '>> Postion Picture
  271. Dim Fo                   As POINTAPI               '>> Region Of FocusRect
  272. '............................................................
  273. '>> Mouse Button >> Hovered Or Pressed
  274. Private MouseMove, MouseDown As Boolean
  275. Attribute MouseDown.VB_VarUserMemId = 1073938462
  276.  
  277. Dim P(0 To 7)            As POINTAPI
  278. Attribute P.VB_VarUserMemId = 1073938464
  279. Dim PL(0 To 7)           As POINTAPI
  280. Attribute PL.VB_VarUserMemId = 1073938465
  281. Dim Lines                As POINTAPI
  282. Attribute Lines.VB_VarUserMemId = 1073938466
  283. Dim hRgn                 As Long
  284. Attribute hRgn.VB_VarUserMemId = 1073938467
  285. '............................................................
  286. '>> Button Event Declaration's
  287. '............................................................
  288. Public Event Click()
  289. Public Event DblClick()
  290. Public Event KeyDown(KeyCode As Integer, Shift As Integer)
  291. Public Event KeyPress(KeyAscii As Integer)
  292. Public Event KeyUp(KeyCode As Integer, Shift As Integer)
  293. Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  294. Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  295. Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  296. Public Event OLECompleteDrag(Effect As Long)
  297. Public Event OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  298. Public Event OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  299. Public Event OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
  300. Public Event OLESetData(Data As DataObject, DataFormat As Integer)
  301. Public Event OLEStartDrag(Data As DataObject, AllowedEffects As Long)
  302. '............................................................
  303. '>> Start Properties Button
  304. '............................................................
  305. Public Property Get hdc() As Long
  306.     hdc = UserControl.hdc
  307. End Property
  308. Public Property Get hWnd() As Long
  309.     hWnd = UserControl.hWnd
  310. End Property
  311. Public Sub Refresh()
  312.     UserControl.Refresh
  313. End Sub
  314.  
  315. Public Property Get ButtonShape() As EnumButtonShape
  316.     ButtonShape = mButtonShape
  317. End Property
  318. Public Property Let ButtonShape(ByVal EBS As EnumButtonShape)
  319.     mButtonShape = EBS
  320.     PropertyChanged "ButtonShape"
  321.     UserControl_Paint
  322. End Property
  323. Public Property Get ButtonStyle() As EnumButtonStyle
  324.     ButtonStyle = mButtonStyle
  325. End Property
  326. Public Property Let ButtonStyle(ByVal EBS As EnumButtonStyle)
  327.     mButtonStyle = EBS
  328.     PropertyChanged "ButtonStyle"
  329.     '.............................................................
  330.     '>> ButtonStyle,Visual, Flat,OverFlat,Java,XpOffice,WinXp
  331.     '>> Vista,Glass
  332.     '>> Default BackColors To ButtonStyle At Hover,Press,Off
  333.     '>> 'Default ForeColors To ButtonStyle At Hover,Press,Off
  334.     '.............................................................
  335.     Select Case mButtonStyle
  336.         Case Is = Visual
  337.             mBackColor = vbButtonFace
  338.             mBackColorHover = vbButtonFace
  339.             mBackColorPressed = vbButtonFace
  340.             'mForeColor = vbBlack
  341.             'mForeColorHover = vbBlack
  342.             'mForeColorPressed = vbBlack
  343.         Case Is = Flat
  344.             mBackColor = vbButtonFace
  345.             mBackColorHover = vbButtonFace
  346.             mBackColorPressed = vbButtonFace
  347.             'mForeColor = vbBlack
  348.             ' mForeColorHover = vbBlack
  349.             'mForeColorPressed = vbBlack
  350.         Case Is = OverFlat
  351.             mBackColor = vbButtonFace
  352.             mBackColorHover = vbButtonFace
  353.             mBackColorPressed = vbButtonFace
  354.             'mForeColor = vbBlack
  355.             'mForeColorHover = vbBlack
  356.             'mForeColorPressed = vbBlack
  357.         Case Is = Java
  358.             If Not mButtonStyleColors = Transparent Then mButtonStyleColors = SingleColor
  359.             mBackColor = vbButtonFace
  360.             mBackColorHover = vbButtonFace
  361.             mBackColorPressed = &H999999
  362.             'mForeColor = vbBlack
  363.             'mForeColorHover = vbBlack
  364.             'mForeColorPressed = vbBlack
  365.         Case Is = XPOffice
  366.             mBackColor = vbButtonFace
  367.             mBackColorHover = &HB6A59F
  368.             mBackColorPressed = &HAF8C80
  369.             'mForeColor = vbBlack
  370.             'mForeColorHover = vbBlack
  371.             'mForeColorPressed = vbBlack
  372.         Case Is = WinXp
  373.             If Not mButtonStyleColors = Transparent Then mButtonStyleColors = Gradient_V
  374.             mBackColor = &HD2DEDD
  375.             mBackColorHover = vbWhite
  376.             mBackColorPressed = vbWhite
  377.             'mForeColor = vbBlack
  378.             'mForeColorHover = vbBlack
  379.             'mForeColorPressed = vbBlack
  380.         Case Is = Vista
  381.             mBackColor = &HD8D8D8
  382.             mBackColorHover = &HF7DBA5
  383.             mBackColorPressed = &HEFCE92
  384.             'mForeColor = &H8000000D    'vbhightlight
  385.             'mForeColorHover = &H8000000D
  386.             'mForeColorPressed = &H8000000D
  387.         Case Is = Glass
  388.             mBackColor = vbDesktop
  389.             mBackColorHover = vbDesktop
  390.             mBackColorPressed = vbDesktop
  391.             'mForeColor = vbWhite
  392.             'mForeColorHover = vbWhite
  393.             'mForeColorPressed = vbWhite
  394.     End Select
  395.     UserControl_Paint
  396. End Property
  397. Public Property Get ButtonStyleColors() As EnumButtonStyleColors
  398.     ButtonStyleColors = mButtonStyleColors
  399. End Property
  400. Public Property Let ButtonStyleColors(ByVal EBSC As EnumButtonStyleColors)
  401.     mButtonStyleColors = EBSC
  402.     PropertyChanged "ButtonStyleColors"
  403.     UserControl_Paint
  404. End Property
  405. Public Property Get ButtonTheme() As EnumButtonTheme
  406.     ButtonTheme = mButtonTheme
  407. End Property
  408. Public Property Let ButtonTheme(ByVal EBT As EnumButtonTheme)
  409.     mButtonTheme = EBT
  410.     PropertyChanged "ButtonTheme"
  411.     '.............................................................
  412.     '>> ButtonTheme,XpBlue,XpOlive,XPSilver,Visual2005,Norton2005
  413.     '>> RedColor,GreenColor,BlueColor.
  414.     '.............................................................
  415.     Select Case mButtonTheme
  416.         Case Is = XpBlue
  417.             mBackColor = &HF1B39A
  418.             mBackColorHover = &HFDF7F4
  419.             mBackColorPressed = &HFAE6DD
  420.             mBorderColor = &HF1B39A
  421.             mBorderColorHover = &HF1B39A
  422.             mBorderColorPressed = &HF1B39A
  423.         Case Is = XpOlive
  424.             mBackColor = &H3DB4A2
  425.             mBackColorHover = &HDFF4F2
  426.             mBackColorPressed = &HB8E7E0
  427.             mBorderColor = &H3DB4A2
  428.             mBorderColorHover = &H3DB4A2
  429.             mBorderColorPressed = &H3DB4A2
  430.         Case Is = XPSilver
  431.             mBackColor = &HB5A09D
  432.             mBackColorHover = &HF7F5F4
  433.             mBackColorPressed = &HECE7E6
  434.             mBorderColor = &HB5A09D
  435.             mBorderColorHover = mBorderColor
  436.             mBorderColorPressed = mBorderColor
  437.         Case Is = Visual2005
  438.             mBackColor = &HABC2C2
  439.             mBackColorHover = &HF2F8F8
  440.             mBackColorPressed = &HE6EDEE
  441.             mBorderColor = &HABC2C2
  442.             mBorderColorHover = mBorderColor
  443.             mBorderColorPressed = mBorderColor
  444.         Case Is = Norton2005
  445.             mBackColor = &H2C5F5
  446.             mBackColorHover = &HE2F9FF
  447.             mBackColorPressed = &HAFEFFE
  448.             mBorderColor = &H2C5F5
  449.             mBorderColorHover = mBorderColor
  450.             mBorderColorPressed = mBorderColor
  451.         Case Is = RedColor
  452.             mBackColor = &H26368B
  453.             mBackColorHover = &H4763FF
  454.             mBackColorPressed = &H425CEE
  455.             mBorderColor = vbRed
  456.             mBorderColorHover = mBorderColor
  457.             mBorderColorPressed = mBorderColor
  458.         Case Is = GreenColor
  459.             mBackColor = &H578B2E
  460.             mBackColorHover = &H9FFF54
  461.             mBackColorPressed = &H80CD43
  462.             mBorderColor = vbGreen
  463.             mBorderColorHover = mBorderColor
  464.             mBorderColorPressed = mBorderColor
  465.         Case Is = BlueColor
  466.             mBackColor = &H8B4027
  467.             mBackColorHover = &HFF7648
  468.             mBackColorPressed = &HCD5F3A
  469.             mBorderColor = vbBlue
  470.             mBorderColorHover = mBorderColor
  471.             mBorderColorPressed = mBorderColor
  472.     End Select
  473.     UserControl_Paint
  474. End Property
  475. Public Property Get ButtonType() As EnumButtonType
  476.     ButtonType = mButtonType
  477. End Property
  478. Public Property Let ButtonType(ByVal EBT As EnumButtonType)
  479.     mButtonType = EBT
  480.     PropertyChanged "ButtonType"
  481.     UserControl_Paint
  482. End Property
  483. Public Property Get CaptionAlignment() As EnumCaptionAlignment
  484.     CaptionAlignment = mCaptionAlignment
  485. End Property
  486. Public Property Let CaptionAlignment(ByVal ECA As EnumCaptionAlignment)
  487.     mCaptionAlignment = ECA
  488.     PropertyChanged "CaptionAlignment"
  489.     UserControl_Paint
  490. End Property
  491. Public Property Get CaptionEffect() As EnumCaptionEffect
  492.     CaptionEffect = mCaptionEffect
  493. End Property
  494. Public Property Let CaptionEffect(ByVal ECE As EnumCaptionEffect)
  495.     mCaptionEffect = ECE
  496.     PropertyChanged "CaptionEffect"
  497.     UserControl_Paint
  498. End Property
  499. Public Property Get CaptionStyle() As EnumCaptionStyle
  500.     CaptionStyle = mCaptionStyle
  501. End Property
  502. Public Property Let CaptionStyle(ByVal ECS As EnumCaptionStyle)
  503.     mCaptionStyle = ECS
  504.     PropertyChanged "CaptionStyle"
  505.     UserControl_Paint
  506. End Property
  507. Public Property Get DropDown() As EnumDropDown
  508.     DropDown = mDropDown
  509. End Property
  510. Public Property Let DropDown(ByVal EDD As EnumDropDown)
  511.     mDropDown = EDD
  512.     PropertyChanged "DropDown"
  513.     UserControl_Paint
  514. End Property
  515. Public Property Get PictureAlignment() As EnumPictureAlignment
  516.     PictureAlignment = mPictureAlignment
  517. End Property
  518. Public Property Let PictureAlignment(ByVal EPA As EnumPictureAlignment)
  519.     mPictureAlignment = EPA
  520.     PropertyChanged "PictureAlignment"
  521.     UserControl_Paint
  522. End Property
  523. Public Property Get BackColor() As OLE_COLOR
  524.     BackColor = mBackColor
  525. End Property
  526. Public Property Let BackColor(ByVal New_Color As OLE_COLOR)
  527.     mBackColor = New_Color
  528.     PropertyChanged "BackColor"
  529.     UserControl_Paint
  530. End Property
  531. Public Property Get BackColorPressed() As OLE_COLOR
  532.     BackColorPressed = mBackColorPressed
  533. End Property
  534. Public Property Let BackColorPressed(ByVal New_Color As OLE_COLOR)
  535.     mBackColorPressed = New_Color
  536.     PropertyChanged "BackColorPressed"
  537.     UserControl_Paint
  538. End Property
  539. Public Property Get BackColorHover() As OLE_COLOR
  540.     BackColorHover = mBackColorHover
  541. End Property
  542. Public Property Let BackColorHover(ByVal New_Color As OLE_COLOR)
  543.     mBackColorHover = New_Color
  544.     PropertyChanged "BackColorHover"
  545.     UserControl_Paint
  546. End Property
  547. Public Property Get BorderColor() As OLE_COLOR
  548.     BorderColor = mBorderColor
  549. End Property
  550. Public Property Let BorderColor(ByVal New_Color As OLE_COLOR)
  551.     mBorderColor = New_Color
  552.     PropertyChanged "BorderColor"
  553.     UserControl_Paint
  554. End Property
  555. Public Property Get BorderColorPressed() As OLE_COLOR
  556.     BorderColorPressed = mBorderColorPressed
  557. End Property
  558. Public Property Let BorderColorPressed(ByVal New_Color As OLE_COLOR)
  559.     mBorderColorPressed = New_Color
  560.     PropertyChanged "BorderColorPressed"
  561.     UserControl_Paint
  562. End Property
  563. Public Property Get BorderColorHover() As OLE_COLOR
  564.     BorderColorHover = mBorderColorHover
  565. End Property
  566. Public Property Let BorderColorHover(ByVal New_Color As OLE_COLOR)
  567.     mBorderColorHover = New_Color
  568.     PropertyChanged "BorderColorHover"
  569.     UserControl_Paint
  570. End Property
  571. Public Property Get ForeColor() As OLE_COLOR
  572.     ForeColor = mForeColor
  573. End Property
  574. Public Property Let ForeColor(ByVal New_Color As OLE_COLOR)
  575.     mForeColor = New_Color
  576.     PropertyChanged "ForeColor"
  577.     UserControl_Paint
  578. End Property
  579. Public Property Get ForeColorPressed() As OLE_COLOR
  580.     ForeColorPressed = mForeColorPressed
  581. End Property
  582. Public Property Let ForeColorPressed(ByVal New_Color As OLE_COLOR)
  583.     mForeColorPressed = New_Color
  584.     PropertyChanged "ForeColorPressed"
  585.     UserControl_Paint
  586. End Property
  587. Public Property Get ForeColorHover() As OLE_COLOR
  588.     ForeColorHover = mForeColorHover
  589. End Property
  590. Public Property Let ForeColorHover(ByVal New_Color As OLE_COLOR)
  591.     mForeColorHover = New_Color
  592.     PropertyChanged "ForeColorHover"
  593.     UserControl_Paint
  594. End Property
  595. Public Property Get EffectColor() As OLE_COLOR
  596.     EffectColor = mEffectColor
  597. End Property
  598. Public Property Let EffectColor(ByVal New_Color As OLE_COLOR)
  599.     mEffectColor = New_Color
  600.     PropertyChanged "EffectColor"
  601.     UserControl_Paint
  602. End Property
  603. Public Property Get Caption() As String
  604.     Caption = mCaption
  605. End Property
  606. Public Property Let Caption(ByVal NewCaption As String)
  607.     mCaption = NewCaption
  608.     PropertyChanged "Caption"
  609.     UserControl_Paint
  610. End Property
  611. Public Property Get FocusRect() As Boolean
  612.     FocusRect = mFocusRect
  613. End Property
  614. Public Property Let FocusRect(ByVal New_FocusRect As Boolean)
  615.     mFocusRect = New_FocusRect
  616.     PropertyChanged "FocusRect"
  617.     UserControl_Paint
  618. End Property
  619. Public Property Get Value() As Boolean
  620.     Value = mValue
  621. End Property
  622. Public Property Let Value(ByVal New_Value As Boolean)
  623.     mValue = New_Value
  624.     PropertyChanged "Value"
  625.     UserControl_Paint
  626. End Property
  627. Public Property Get HandPointer() As Boolean
  628.     HandPointer = mHandPointer
  629. End Property
  630. Public Property Let HandPointer(ByVal New_HandPointer As Boolean)
  631.     mHandPointer = New_HandPointer
  632.     PropertyChanged "HandPointer"
  633.     UserControl_Paint
  634. End Property
  635. Public Property Get Picture() As Picture
  636.     Set Picture = mPicture
  637. End Property
  638. Public Property Set Picture(ByVal New_Picture As Picture)
  639.     Set mPicture = New_Picture
  640.     PropertyChanged "Picture"
  641.     UserControl_Paint
  642. End Property
  643. Public Property Get PictureGray() As Boolean
  644.     PictureGray = mPictureGray
  645. End Property
  646. Public Property Let PictureGray(ByVal New_PictureGray As Boolean)
  647.     mPictureGray = New_PictureGray
  648.     PropertyChanged "PictureGray"
  649.     UserControl_Paint
  650. End Property
  651. '............................................................
  652. '............................................................
  653. Public Property Get Enabled() As Boolean
  654.     Enabled = UserControl.Enabled
  655. End Property
  656. Public Property Let Enabled(ByVal New_Enabled As Boolean)
  657.     UserControl.Enabled = New_Enabled
  658.     PropertyChanged "Enabled"
  659.     UserControl_Paint
  660. End Property
  661. Public Property Get Font() As Font
  662.     Set Font = UserControl.Font
  663. End Property
  664. Public Property Set Font(ByVal New_Font As Font)
  665.     Set UserControl.Font = New_Font
  666.     PropertyChanged "Font"
  667.     UserControl_Paint
  668. End Property
  669. Public Property Get MousePointer() As MousePointerConstants
  670.     MousePointer = UserControl.MousePointer
  671. End Property
  672. Public Property Let MousePointer(ByVal New_MousePointer As MousePointerConstants)
  673.     UserControl.MousePointer() = New_MousePointer
  674.     PropertyChanged "MousePointer"
  675.     UserControl_Paint
  676. End Property
  677. Public Property Get MouseIcon() As Picture
  678.     Set MouseIcon = UserControl.MouseIcon
  679. End Property
  680. Public Property Set MouseIcon(ByVal New_MouseIcon As Picture)
  681.     Set UserControl.MouseIcon() = New_MouseIcon
  682.     PropertyChanged "MouseIcon"
  683.     UserControl_Paint
  684. End Property
  685. '............................................................
  686. '>> End Properties
  687. '............................................................
  688.  
  689. '............................................................
  690. '>> Convert Color's >> Red,Green,Blue To VB Color's
  691. '............................................................
  692. Private Sub ConvertRGB(ByVal Color As Long, R, G, B As Long)
  693.     TranslateColor Color, 0, Color
  694.     R = Color And vbRed
  695.     G = (Color And vbGreen) / 256
  696.     B = (Color And vbBlue) / 65536
  697. End Sub
  698. '............................................................
  699. '>> Start UserControl
  700. '............................................................
  701. Private Sub UserControl_Click()
  702.     '>> Start The Button Pressed
  703.     If Me.ButtonType = CheckBox Then mValue = MouseDown = False
  704.     UserControl_Paint
  705.     RaiseEvent Click
  706. End Sub
  707. Private Sub UserControl_DblClick()
  708.     '>> Start The Button Pressed Too
  709.     MouseDown = True
  710.     UserControl_Paint
  711.     RaiseEvent DblClick
  712. End Sub
  713. Private Sub UserControl_GotFocus()
  714.     '>> Show FocusRect If Click Button
  715.     mFocused = True
  716.     UserControl_Paint
  717. End Sub
  718. Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer)
  719.     If KeyCode = 32 Or KeyCode = 13 Then                   '>> Space Or '>> Enter
  720.         MouseDown = True
  721.         UserControl_Paint
  722.     End If
  723.     RaiseEvent KeyDown(KeyCode, Shift)
  724. End Sub
  725. Private Sub UserControl_KeyPress(KeyAscii As Integer)
  726.     RaiseEvent KeyPress(KeyAscii)
  727. End Sub
  728. Private Sub UserControl_KeyUp(KeyCode As Integer, Shift As Integer)
  729.     If MouseDown = True Then
  730.         MouseDown = False
  731.         UserControl_Paint
  732.         '>> Return Button To Original Shape If ButtonType >> CheckBox
  733.         If KeyCode = vbKeyReturn Then UserControl_MouseDown 0, 0, 0, 0
  734.     End If
  735.     RaiseEvent KeyUp(KeyCode, Shift)
  736. End Sub
  737. Private Sub UserControl_LostFocus()
  738.     '>> Visible FocusRect If Clicked Another Button
  739.     mFocused = False
  740.     UserControl_Paint
  741. End Sub
  742. Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  743.     '>> Start The Button Pressed
  744.     MouseDown = True
  745.     UserControl_Paint
  746.     RaiseEvent MouseDown(Button, Shift, X, Y)
  747. End Sub
  748. Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  749.     Dim pt               As POINTAPI
  750.     Dim Hovered          As Boolean                         '>> False Or Ture
  751.     With UserControl
  752.         GetCursorPos pt
  753.         ScreenToClient .hWnd, pt
  754.         '>> We Don't Need To Check Postion Mouse
  755.         If Not UserControl.Ambient.UserMode Then Exit Sub
  756.         ' See If The Mouse Is Over The Control
  757.         If (pt.X < 0) Or (pt.Y < 0) Or (pt.X > .ScaleWidth) Or (pt.Y > .ScaleHeight) Then
  758.             Hovered = False                                '>> Mouse Is Leave Of Button
  759.             ReleaseCapture
  760.         Else
  761.             Hovered = True                                 '>> Mouse Over Button
  762.             SetCapture .hWnd
  763.         End If
  764.         ' Redraw The Control If Necessary
  765.         If MouseMove <> Hovered Then
  766.             MouseMove = Hovered
  767.             MouseDown = False
  768.             UserControl_Paint
  769.         End If
  770.     End With
  771.     RaiseEvent MouseMove(Button, Shift, X, Y)
  772. End Sub
  773. Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  774.     If GetCapture() <> UserControl.hWnd Then SetCapture UserControl.hWnd
  775.     Dim Pressed          As Boolean
  776.     ' Raise The Click Event If The Button Is Currently Pressed
  777.     If Pressed Then RaiseEvent Click
  778.     Pressed = MouseDown
  779.     ' Stop The Button Pressed
  780.     MouseDown = False
  781.     UserControl_Paint
  782.     RaiseEvent MouseUp(Button, Shift, X, Y)
  783. End Sub
  784. Private Sub UserControl_InitProperties()
  785.     'On Local Error Resume Next
  786.     UserControl.Width = 1200
  787.     UserControl.Height = 500
  788.  
  789.     mButtonShape = Rectangle
  790.     mButtonStyle = Visual
  791.     mButtonStyleColors = SingleColor
  792.     mButtonTheme = NoTheme
  793.     mButtonType = Button
  794.     mCaptionAlignment = CenterCaption
  795.     mCaptionStyle = Normal
  796.     mCaptionEffect = Default
  797.     mDropDown = None
  798.     mPictureAlignment = CenterPicture
  799.  
  800.     mBackColor = vbButtonFace
  801.     mBackColorPressed = vbButtonFace
  802.     mBackColorHover = vbButtonFace
  803.  
  804.     'mBorderColor = vbBlack
  805.     'mBorderColorHover = vbBlack
  806.     'mBorderColorPressed = vbBlack
  807.  
  808.     mForeColor = vbBlack
  809.     mForeColorPressed = vbRed
  810.     mForeColorHover = vbBlue
  811.     mEffectColor = vbWhite
  812.  
  813.     mCaption = Ambient.DisplayName
  814.     mFocusRect = True
  815.     mValue = False
  816.     mHandPointer = False
  817.     Set mPicture = Nothing
  818.     mPictureGray = False
  819.     UserControl.Enabled = True
  820.     UserControl.Font = "Tahoma"
  821.     UserControl_Paint
  822. End Sub
  823. Private Sub UserControl_OLECompleteDrag(Effect As Long)
  824.     RaiseEvent OLECompleteDrag(Effect)
  825. End Sub
  826. Private Sub UserControl_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  827.     RaiseEvent OLEDragDrop(Data, Effect, Button, Shift, X, Y)
  828. End Sub
  829. Private Sub UserControl_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  830.     RaiseEvent OLEDragOver(Data, Effect, Button, Shift, X, Y, State)
  831. End Sub
  832. Private Sub UserControl_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
  833.     RaiseEvent OLEGiveFeedback(Effect, DefaultCursors)
  834. End Sub
  835. Private Sub UserControl_OLESetData(Data As DataObject, DataFormat As Integer)
  836.     RaiseEvent OLESetData(Data, DataFormat)
  837. End Sub
  838. Private Sub UserControl_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
  839.     RaiseEvent OLEStartDrag(Data, AllowedEffects)
  840. End Sub
  841. Private Sub UserControl_Paint()
  842.     'On Local Error Resume Next
  843.     With UserControl
  844.         .AutoRedraw = True
  845.         .ScaleMode = 3
  846.         .Cls
  847.         '............................................................
  848.         '>> Width = Height To Nice Show Border's.
  849.         '............................................................
  850.         If .Width < 375 Then .Width = 375
  851.         If .Height < 375 Then .Height = 375
  852.         If Not mButtonShape = Rectangle Then
  853.             If Not mButtonShape = RoundedRectangle Then
  854.                 If .Width > .Height Then .Height = .Width Else .Height = .Width
  855.             End If
  856.         End If
  857.         '............................................................
  858.         '>> Change MousePointer To HandCursor
  859.         '............................................................
  860.         If MouseDown Then
  861.             If mFocused And mHandPointer Then SetCursor LoadCursor(0, CURSOR_HAND)
  862.         ElseIf MouseMove Then
  863.             If mHandPointer Then SetCursor LoadCursor(0, CURSOR_HAND)
  864.         Else
  865.             If mFocused And mHandPointer Then SetCursor LoadCursor(0, CURSOR_HAND)
  866.         End If
  867.         '............................................................
  868.         '>> Use Value For Viwe CheckBox(ButtonPressed) At TimeShow
  869.         '............................................................
  870.         Select Case mButtonType
  871.             Case Is = CheckBox
  872.                 If mValue Then MouseDown = True
  873.         End Select
  874.         '............................................................
  875.         '>> Change BackColor When Mouse Hovered Or Pressed Or Off
  876.         '............................................................
  877.         Dim BkRed(0 To 1), BkGreen(0 To 1), BkBlue(0 To 1) As Long
  878.         Dim vert(1) As TRIVERTEX, GRect As GRADIENT_RECT
  879.         If MouseDown Then
  880.             ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  881.             ConvertRGB mBackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  882.         ElseIf MouseMove Then
  883.             ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  884.             ConvertRGB mBackColorHover, BkRed(1), BkGreen(1), BkBlue(1)
  885.         Else
  886.             ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  887.             ConvertRGB mBackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  888.         End If
  889.         vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  890.         vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  891.         GRect.UpperLeft = 1: GRect.LowerRight = 0
  892.         '............................................................
  893.         '>> ButtonStyleColors,Transparent,SingleColour
  894.         '>> GradientHorizontalFill,VerticalGradientFill
  895.         '>> SwapHorizontalFill,SwapVerticalFill,GradientTubeCenter_H
  896.         '>> ,GradientTubeTopBottom_H,GradientTubeCenter_V
  897.         '>> GradientTubeTopBottom_V
  898.         '............................................................
  899.         Select Case mButtonStyleColors
  900.             Case Is = Transparent
  901.                 .BackStyle = 0
  902.             Case Is = SingleColor
  903.                 .BackStyle = 1
  904.                 If MouseDown Then
  905.                     .BackColor = mBackColorPressed
  906.                 Else
  907.                     If MouseMove Then
  908.                         .BackColor = mBackColorHover
  909.                     Else
  910.                         .BackColor = mBackColor
  911.                     End If
  912.                 End If
  913.             Case Is = Gradient_H
  914.                 .BackStyle = 1
  915.                 vert(0).X = 0: vert(0).Y = .ScaleHeight
  916.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  917.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  918.             Case Is = Gradient_V
  919.                 .BackStyle = 1
  920.                 vert(0).X = 0: vert(0).Y = .ScaleHeight
  921.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  922.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  923.             Case Is = TubeCenter_H
  924.                 .BackStyle = 1
  925.                 vert(0).X = .ScaleWidth: vert(0).Y = 0
  926.                 vert(1).X = 0: vert(1).Y = .ScaleHeight / 2
  927.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  928.                 vert(0).X = 0: vert(0).Y = .ScaleHeight
  929.                 vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight / 2
  930.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  931.             Case Is = TubeTopBottom_H
  932.                 .BackStyle = 1
  933.                 vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  934.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  935.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  936.                 vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  937.                 vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight
  938.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  939.             Case Is = TubeCenter_V
  940.                 .BackStyle = 1
  941.                 vert(0).X = 0: vert(0).Y = 0
  942.                 vert(1).X = .ScaleWidth / 2: vert(1).Y = .ScaleHeight
  943.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  944.                 vert(0).X = .ScaleWidth: vert(0).Y = .ScaleHeight
  945.                 vert(1).X = .ScaleWidth / 2: vert(1).Y = 0
  946.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  947.             Case Is = TubeTopBottom_V
  948.                 .BackStyle = 1
  949.                 vert(0).X = .ScaleWidth / 2: vert(0).Y = 0
  950.                 vert(1).X = 0: vert(1).Y = .ScaleHeight
  951.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  952.                 vert(0).X = .ScaleWidth / 2: vert(0).Y = .ScaleHeight
  953.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  954.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  955.         End Select
  956.         '.............................................................
  957.         '>> ButtonStyle,Visual, Flat,OverFlat,Java,XpOffice,WinXp
  958.         '>> Vista,Glass
  959.         '>> Set BorderColors To ButtonStyle At Hover,Press,Off
  960.         '.............................................................
  961.         Select Case mButtonStyle
  962.             Case Is = Visual
  963.                 mBorderColor = vb3DDKShadow
  964.                 mBorderColorHover = vb3DDKShadow
  965.                 mBorderColorPressed = vb3DHighlight
  966.             Case Is = Flat
  967.                 mBorderColor = vb3DDKShadow
  968.                 mBorderColorHover = vb3DDKShadow
  969.                 mBorderColorPressed = vb3DHighlight
  970.             Case Is = OverFlat
  971.                 mBorderColor = mBackColor    '>> Visible BorderColor At RunTime
  972.                 mBorderColorHover = vb3DDKShadow
  973.                 mBorderColorPressed = vb3DHighlight
  974.             Case Is = Java
  975.                 mBorderColor = vbButtonShadow
  976.                 mBorderColorHover = vbButtonShadow
  977.                 mBorderColorPressed = vbButtonShadow
  978.             Case Is = XPOffice
  979.                 mBorderColor = vbButtonFace
  980.                 mBorderColorHover = vbBlack
  981.                 mBorderColorPressed = vbBlack
  982.                 '............................................................
  983.                 '>> Change BackColor XpOffice When Mouse Hovered,Pressed,Off
  984.                 '............................................................
  985.                 If Not mButtonStyleColors = Transparent Then
  986.                     If MouseDown Then
  987.                         ConvertRGB &HA57F71, BkRed(0), BkGreen(0), BkBlue(0)
  988.                         ConvertRGB mBackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  989.                     ElseIf MouseMove Then
  990.                         ConvertRGB &HAC9891, BkRed(0), BkGreen(0), BkBlue(0)
  991.                         ConvertRGB mBackColorHover, BkRed(1), BkGreen(1), BkBlue(1)
  992.                     Else
  993.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  994.                         ConvertRGB mBackColor, BkRed(1), BkGreen(1), BkBlue(1)
  995.                     End If
  996.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  997.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  998.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  999.                     vert(0).X = 0: vert(0).Y = .ScaleHeight
  1000.                     vert(1).X = .ScaleWidth: vert(1).Y = 0
  1001.                     GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1002.                 End If
  1003.             Case Is = WinXp
  1004.                 mBorderColor = vbBlack
  1005.                 mBorderColorHover = vbBlack
  1006.                 mBorderColorPressed = vbBlack
  1007.                 '............................................................
  1008.                 '>> Change BackColor WinXp When Mouse Hovered,Pressed,Off
  1009.                 '............................................................
  1010.                 If Not mButtonStyleColors = Transparent Then
  1011.                     If MouseDown Then
  1012.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1013.                         ConvertRGB &HE0E6E6, BkRed(1), BkGreen(1), BkBlue(1)
  1014.                     ElseIf .Enabled Then
  1015.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1016.                         ConvertRGB Me.BackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  1017.                     Else
  1018.                         ConvertRGB &HDBE7E7, BkRed(0), BkGreen(0), BkBlue(0)
  1019.                         ConvertRGB &HDBE7E7, BkRed(1), BkGreen(1), BkBlue(1)
  1020.                         mBorderColor = &H8DABAB
  1021.                     End If
  1022.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  1023.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  1024.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  1025.                     vert(0).X = 0: vert(0).Y = .ScaleHeight
  1026.                     vert(1).X = .ScaleWidth: vert(1).Y = 0
  1027.                     GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1028.                 End If
  1029.             Case Is = Vista
  1030.                 mBorderColor = &H8F8F8E
  1031.                 mBorderColorHover = &HB17F3C
  1032.                 mBorderColorPressed = &H5C411D
  1033.                 '............................................................
  1034.                 '>> Change BackColor Vista When Mouse Hovered,Pressed,Off
  1035.                 '............................................................
  1036.                 If Me.ButtonStyle = Vista And Not Me.ButtonStyleColors = Transparent Then
  1037.                     If MouseDown Then
  1038.                         ConvertRGB &HF8ECD5, BkRed(1), BkGreen(1), BkBlue(1)
  1039.                         ConvertRGB mBackColorPressed, BkRed(0), BkGreen(0), BkBlue(0)
  1040.                     ElseIf MouseMove Then
  1041.                         ConvertRGB &HFEFCF7, BkRed(1), BkGreen(1), BkBlue(1)
  1042.                         ConvertRGB mBackColorHover, BkRed(0), BkGreen(0), BkBlue(0)
  1043.                     ElseIf .Enabled Then
  1044.                         ConvertRGB &HEFEFEF, BkRed(1), BkGreen(1), BkBlue(1)
  1045.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1046.                     Else
  1047.                         ConvertRGB &HF4F4F4, BkRed(1), BkGreen(1), BkBlue(1)
  1048.                         ConvertRGB &HF0F0F0, BkRed(0), BkGreen(0), BkBlue(0)
  1049.                         mBorderColor = &HB5B2AD
  1050.                     End If
  1051.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  1052.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  1053.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  1054.                     If mButtonShape = Top_Triangle Or mButtonShape = Down_Triangle _
  1055.                             Or mButtonShape = top_Arrow Or mButtonShape = Down_Arrow Then
  1056.                         vert(0).X = .ScaleWidth / 1.5: vert(0).Y = 0
  1057.                         vert(1).X = 0: vert(1).Y = .ScaleHeight
  1058.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1059.                         vert(0).X = .ScaleWidth / 2: vert(0).Y = .ScaleHeight
  1060.                         vert(1).X = .ScaleWidth + 25: vert(1).Y = 0
  1061.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1062.                     Else
  1063.                         vert(0).X = 0: vert(0).Y = .ScaleHeight / 1.5
  1064.                         vert(1).X = .ScaleWidth: vert(1).Y = 0
  1065.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1066.                         vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  1067.                         vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight + 25
  1068.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1069.                     End If
  1070.                 End If
  1071.             Case Is = Glass
  1072.                 mBorderColor = mBackColor
  1073.                 mBorderColorHover = mBackColorHover
  1074.                 mBorderColorPressed = mBackColorPressed
  1075.                 '............................................................
  1076.                 '>> Change BackColor Glass When Mouse Hovered,Pressed,Off
  1077.                 '............................................................
  1078.                 If Not mButtonStyleColors = Transparent Then
  1079.                     If MouseDown Then
  1080.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1081.                         ConvertRGB mBackColorPressed, BkRed(0), BkGreen(0), BkBlue(0)
  1082.                     ElseIf MouseMove Then
  1083.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1084.                         ConvertRGB mBackColorHover, BkRed(0), BkGreen(0), BkBlue(0)
  1085.                     ElseIf .Enabled Then
  1086.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1087.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1088.                     Else
  1089.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1090.                         ConvertRGB &HA4B6B7, BkRed(0), BkGreen(0), BkBlue(0)
  1091.                         mBorderColor = &HA4B6B7
  1092.                     End If
  1093.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  1094.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  1095.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  1096.                     If mButtonShape = Top_Triangle Or mButtonShape = Down_Triangle _
  1097.                             Or mButtonShape = top_Arrow Or mButtonShape = Down_Arrow Then
  1098.                         vert(0).X = .ScaleWidth: vert(0).Y = 0
  1099.                         vert(1).X = -.ScaleWidth / 6: vert(1).Y = .ScaleHeight
  1100.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1101.                         vert(0).X = .ScaleWidth / 2: vert(0).Y = .ScaleHeight
  1102.                         vert(1).X = .ScaleWidth + .ScaleWidth / 3: vert(1).Y = 0
  1103.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1104.                     Else
  1105.                         vert(0).X = 0: vert(0).Y = .ScaleHeight
  1106.                         vert(1).X = .ScaleWidth: vert(1).Y = -.ScaleHeight / 6
  1107.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1108.                         vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  1109.                         vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight + .ScaleHeight / 3
  1110.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1111.                     End If
  1112.                 End If
  1113.         End Select
  1114.         '............................................................
  1115.         '>> Get Postion Picture
  1116.         '............................................................
  1117.         If mPicture Is Nothing Then
  1118.             PicturePos(1).X = 0
  1119.             PicturePos(1).Y = 0
  1120.         Else
  1121.             PicturePos(1).X = ScaleX(mPicture.Width, vbHimetric, vbPixels)
  1122.             PicturePos(1).Y = ScaleY(mPicture.Height, vbHimetric, vbPixels)
  1123.             '............................................................
  1124.             '>> PictureAlignment,Top PictureLeft Picture,Center Picture
  1125.             '>> Right Picture,Bottom Picture
  1126.             '............................................................
  1127.             Select Case mPictureAlignment
  1128.                 Case Is = TopPicture
  1129.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / 2
  1130.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / .ScaleHeight + 4
  1131.                 Case Is = LeftPicture
  1132.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / .ScaleWidth + 4
  1133.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / 2
  1134.                 Case Is = CenterPicture
  1135.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / 2
  1136.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / 2
  1137.                 Case Is = RightPicture
  1138.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) - 5
  1139.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / 2
  1140.                 Case Is = BottomPicture
  1141.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / 2
  1142.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) - 5
  1143.             End Select
  1144.             '............................................................
  1145.             '>> Moving The Picture When Mouse Hovered Or Pressed
  1146.             '............................................................
  1147.             If Enabled = True Then
  1148.                 Dim GrPic As POINTAPI
  1149.                 Dim Gray As Long
  1150.                 If MouseDown Then
  1151.                     .PaintPicture mPicture, PicturePos(0).X + 1, PicturePos(0).Y + 1    '>> +1 Pixel To Top And Right
  1152.                 ElseIf MouseMove Then
  1153.                     .PaintPicture mPicture, PicturePos(0).X, PicturePos(0).Y
  1154.                     '>> If mButtonStyle = XPOffice Then -1 Pixel About Postion Picture When Mouse Hovered
  1155.                     If mButtonStyle = XPOffice Then .PaintPicture mPicture, PicturePos(0).X - 1, PicturePos(0).Y - 1
  1156.                 Else
  1157.                     .PaintPicture mPicture, PicturePos(0).X, PicturePos(0).Y
  1158.                     '>> Add Little Of Code's To Draw GrayScale Picture.
  1159.                     If mPictureGray = True Then
  1160.                         For GrPic.X = PicturePos(0).X To PicturePos(0).X + PicturePos(1).X
  1161.                             For GrPic.Y = PicturePos(0).Y To PicturePos(0).Y + PicturePos(1).Y
  1162.                                 Gray = 255 And (GetPixel(.hdc, GrPic.X, GrPic.Y))
  1163.                                 'Gray = vbRed And (GetPixel(.hDC, GrPic.X, GrPic.Y))
  1164.                                 If GetPixel(.hdc, GrPic.X, GrPic.Y) <> mBackColor Then
  1165.                                     SetPixel hdc, GrPic.X, GrPic.Y, RGB(Gray, Gray, Gray)
  1166.                                 End If
  1167.                             Next GrPic.Y
  1168.                         Next GrPic.X
  1169.                     End If
  1170.                 End If
  1171.             Else                                               '>> If Enabled = False Then
  1172.                 '............................................................
  1173.                 '>> Converting Picture Colour's To Black Color If Button
  1174.                 '>> Disabled
  1175.                 '............................................................
  1176.                 .PaintPicture mPicture, PicturePos(0).X, PicturePos(0).Y
  1177.                 For GrPic.X = PicturePos(0).X To PicturePos(0).X + PicturePos(1).X
  1178.                     For GrPic.Y = PicturePos(0).Y To PicturePos(0).Y + PicturePos(1).Y
  1179.                         Gray = 255 And (GetPixel(.hdc, GrPic.X, GrPic.Y)) / 65536
  1180.                         If GetPixel(.hdc, GrPic.X, GrPic.Y) <> mBackColor Then
  1181.                             SetPixel hdc, GrPic.X, GrPic.Y, RGB(Gray, Gray, Gray)
  1182.                         End If
  1183.                     Next GrPic.Y
  1184.                 Next GrPic.X
  1185.             End If
  1186.         End If
  1187.         '............................................................
  1188.         '>> CaptionAlignment,Get Size And Postion Text,Top Text
  1189.         '>>Left Text,Center Text,Right Text,Bottom Text
  1190.         '............................................................
  1191.         If Len(mCaption) < 0 Then Exit Sub
  1192.         Select Case mCaptionAlignment
  1193.             Case Is = TopCaption
  1194.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1195.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / 2
  1196.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / .ScaleHeight + 5
  1197.             Case Is = LeftCaption
  1198.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1199.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / .ScaleWidth + 5
  1200.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / 2
  1201.             Case Is = CenterCaption
  1202.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1203.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / 2
  1204.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / 2
  1205.             Case Is = RightCaption
  1206.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1207.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) - 5
  1208.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / 2
  1209.             Case Is = BottomCaption
  1210.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1211.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / 2
  1212.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) - 5
  1213.         End Select
  1214.         '............................................................
  1215.         '>> CaptionEffect,Default,Raised,Sunken,Outline
  1216.         '............................................................
  1217.         Dim EFF          As POINTAPI
  1218.         If Enabled = True Then
  1219.             Select Case mCaptionEffect
  1220.                 Case Is = Default
  1221.                     If MouseDown Then
  1222.                         .ForeColor = mForeColorPressed
  1223.                         TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1224.                     ElseIf MouseMove Then
  1225.                         .ForeColor = mForeColorHover
  1226.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1227.                     Else
  1228.                         .ForeColor = mForeColor
  1229.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1230.                     End If
  1231.                 Case Is = Raised
  1232.                     EFF.X = -1                             '>> -1 Pixel From Down To Top
  1233.                     EFF.Y = -1                             '>> -1 Pixel From Right To Left
  1234.                     If MouseDown Then
  1235.                         .ForeColor = mEffectColor          '>> Vbwhite
  1236.                         TextOutW .hdc, CaptionPos(0).X + EFF.X + 1, CaptionPos(0).Y + EFF.Y + 1, mCaption, Len(mCaption)
  1237.                         .ForeColor = mForeColorPressed       '>> mForeColorPressed If You Like.
  1238.                         TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1239.                     ElseIf MouseMove Then
  1240.                         .ForeColor = mEffectColor          '>> Vbwhite
  1241.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1242.                         .ForeColor = mForeColorHover
  1243.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1244.                     Else
  1245.                         .ForeColor = mEffectColor
  1246.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1247.                         .ForeColor = mForeColor
  1248.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1249.                     End If
  1250.                 Case Is = Sunken
  1251.                     EFF.X = 1                              '>> +1 Pixel From Top To Down
  1252.                     EFF.Y = 1                              '>> +1 Pixel From Left To Right
  1253.                     If MouseDown Then
  1254.                         .ForeColor = mEffectColor          '>> Vbwhite
  1255.                         TextOutW .hdc, CaptionPos(0).X + EFF.X + 1, CaptionPos(0).Y + EFF.Y + 1, mCaption, Len(mCaption)
  1256.                         .ForeColor = mForeColorPressed       '>> mForeColorPressed
  1257.                         TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1258.                     ElseIf MouseMove Then
  1259.                         .ForeColor = mEffectColor          '>> Vbwhite
  1260.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1261.                         .ForeColor = mForeColorHover
  1262.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1263.                     Else
  1264.                         .ForeColor = mEffectColor
  1265.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1266.                         .ForeColor = mForeColor
  1267.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1268.                     End If
  1269.                 Case Is = Outline
  1270.                     Dim Out As POINTAPI
  1271.                     For Out.X = -1 To 1                    '>> -1 Pixel And +1 Pixel From Top To Down
  1272.                         For Out.Y = -1 To 1                '>> -1 Pixel And +1 Pixel From Left To Right
  1273.                             If MouseDown Then
  1274.                                 .ForeColor = mEffectColor
  1275.                                 TextOutW .hdc, CaptionPos(0).X + Out.X + 1, CaptionPos(0).Y + Out.Y + 1, mCaption, Len(mCaption)
  1276.                                 .ForeColor = mForeColorPressed
  1277.                                 TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1278.                             ElseIf MouseMove Then
  1279.                                 .ForeColor = mEffectColor
  1280.                                 TextOutW .hdc, CaptionPos(0).X + Out.X, CaptionPos(0).Y + Out.Y, mCaption, Len(mCaption)
  1281.                                 .ForeColor = mForeColorHover
  1282.                                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1283.                             Else
  1284.                                 .ForeColor = mEffectColor
  1285.                                 TextOutW .hdc, CaptionPos(0).X + Out.X, CaptionPos(0).Y + Out.Y, mCaption, Len(mCaption)
  1286.                                 .ForeColor = mForeColor
  1287.                                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1288.                             End If
  1289.                         Next Out.Y
  1290.                     Next Out.X
  1291.             End Select
  1292.         Else    '>> If Enabled = False Then >> Draw Disabled Text Sunken Look
  1293.             If mButtonStyle = Java Or mButtonStyle = WinXp Or _
  1294.                     mButtonStyle = Vista Or mButtonStyle = Glass Then
  1295.                 .ForeColor = vb3DShadow
  1296.                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1297.             Else    '>> If Enabled = False Then >> Draw Disabled Text Sunken Look
  1298.                 .ForeColor = vb3DHighlight
  1299.                 TextOutW .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1300.                 .ForeColor = vb3DShadow
  1301.                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1302.             End If
  1303.         End If
  1304.         '............................................................
  1305.         '>> Change ForeColor When Mouse Hovered Or Pressed Or Off
  1306.         '............................................................
  1307.         Dim TotalRed(1), TotalGreen(1), TotalBlue(1) As Long
  1308.         Dim R(1), G(1), B(1) As Long
  1309.         Dim FrRed, FrGreen, FrBlue As Integer
  1310.         Dim Pos(1)       As POINTAPI
  1311.         Dim Fore         As POINTAPI
  1312.         '............................................................
  1313.         '>> CaptionStyle,SingleColour,GradientHorizontalFill
  1314.         '>> GradientVerticalFill
  1315.         '............................................................
  1316.         Select Case mCaptionStyle
  1317.             Case Is = Normal                      '>> SingleColour >> MouseOff,MouseMove,MouseDown
  1318.                 'We Don't Need To Any More Event's Here
  1319.                 '>> Look To Event's '>> mCaptionEffect = Default
  1320.             Case Is = HorizontalFill                       '>> GradientFill Len(Caption)
  1321.                 If MouseDown Then
  1322.                     ConvertRGB mForeColor, R(1), G(1), B(1)
  1323.                     ConvertRGB mForeColorPressed, R(0), G(0), B(0)
  1324.                 ElseIf MouseMove Then
  1325.                     ConvertRGB mForeColor, R(1), G(1), B(1)
  1326.                     ConvertRGB mForeColorHover, R(0), G(0), B(0)
  1327.                 Else
  1328.                     ConvertRGB mForeColor, R(1), G(1), B(1)
  1329.                     ConvertRGB mForeColorPressed, R(0), G(0), B(0)
  1330.                 End If
  1331.                 For Fore.X = CaptionPos(0).X To CaptionPos(0).X + CaptionPos(1).X
  1332.                     For Fore.Y = CaptionPos(0).Y To CaptionPos(0).Y + CaptionPos(1).Y
  1333.                         TotalRed(0) = (R(0) - R(1)) / .ScaleWidth * Fore.X
  1334.                         TotalGreen(0) = (G(0) - G(1)) / .ScaleWidth * Fore.X
  1335.                         TotalBlue(0) = (B(0) - B(1)) / .ScaleWidth * Fore.X
  1336.                         FrRed = R(1) + TotalRed(0)
  1337.                         FrGreen = G(1) + TotalGreen(0)
  1338.                         FrBlue = B(1) + TotalBlue(0)
  1339.                         If GetPixel(hdc, Fore.X, Fore.Y) = .ForeColor Then
  1340.                             'If GetPixel(hdc, Fore.X, Fore.Y) <> .ForeColor Then'>> For Show Len(Caption) Fill
  1341.                             SetPixel .hdc, Fore.X, Fore.Y, RGB(FrRed, FrGreen, FrBlue)
  1342.                             R(1) = R(1) + TotalRed(1)
  1343.                             G(1) = G(1) + TotalGreen(1)
  1344.                             B(1) = B(1) + TotalBlue(1)
  1345.                         End If
  1346.                     Next Fore.Y
  1347.                 Next Fore.X
  1348.             Case Is = VerticalFill
  1349.                 If MouseDown Then
  1350.                     ConvertRGB mForeColor, R(0), G(0), B(0)
  1351.                     ConvertRGB mForeColorPressed, R(1), G(1), B(1)
  1352.                 ElseIf MouseMove Then
  1353.                     ConvertRGB mForeColor, R(0), G(0), B(0)
  1354.                     ConvertRGB mForeColorHover, R(1), G(1), B(1)
  1355.                 Else
  1356.                     ConvertRGB mForeColor, R(0), G(0), B(0)
  1357.                     ConvertRGB mForeColorPressed, R(1), G(1), B(1)
  1358.                 End If
  1359.                 For Fore.X = CaptionPos(0).X To CaptionPos(0).X + CaptionPos(1).X
  1360.                     For Fore.Y = CaptionPos(0).Y To CaptionPos(0).Y + CaptionPos(1).Y
  1361.                         TotalRed(0) = (R(0) - R(1)) / .ScaleHeight * Fore.Y
  1362.                         TotalGreen(0) = (G(0) - G(1)) / .ScaleHeight * Fore.Y
  1363.                         TotalBlue(0) = (B(0) - B(1)) / .ScaleHeight * Fore.Y
  1364.                         FrRed = R(1) + TotalRed(0)
  1365.                         FrGreen = G(1) + TotalGreen(0)
  1366.                         FrBlue = B(1) + TotalBlue(0)
  1367.                         If GetPixel(hdc, Fore.X, Fore.Y) = .ForeColor Then
  1368.                             SetPixel .hdc, Fore.X, Fore.Y, RGB(FrRed, FrGreen, FrBlue)
  1369.                             R(1) = R(1) + TotalRed(1)
  1370.                             G(1) = G(1) + TotalGreen(1)
  1371.                             B(1) = B(1) + TotalBlue(1)
  1372.                         End If
  1373.                     Next Fore.Y
  1374.                 Next Fore.X
  1375.         End Select
  1376.         .MaskColor = .BackColor                            '>> Change ButtonStyleColor From Opaque To Transparent
  1377.         '............................................................
  1378.         '>> Change BorderColor When Mouse Hovered Or Pressed Or Off
  1379.         '............................................................
  1380.         If MouseDown Then
  1381.             .ForeColor = mBorderColorPressed
  1382.         ElseIf MouseMove Then
  1383.             .ForeColor = mBorderColorHover
  1384.         Else
  1385.             .ForeColor = mBorderColor
  1386.         End If
  1387.         '............................................................
  1388.         '>> Calling ButtonShape's
  1389.         '............................................................
  1390.         Select Case mButtonShape
  1391.             Case Is = Rectangle: Redraw_Rectangle
  1392.             Case Is = RoundedRectangle: Redraw_RoundedRectangle
  1393.             Case Is = Round: Redraw_Round
  1394.             Case Is = Diamond: Redraw_Diamond
  1395.             Case Is = Top_Triangle: Redraw_Top_Triangle
  1396.             Case Is = Left_Triangle: Redraw_Left_Triangle
  1397.             Case Is = Right_Triangle: Redraw_Right_Triangle
  1398.             Case Is = Down_Triangle: Redraw_Down_Triangle
  1399.             Case Is = top_Arrow: Redraw_Top_Arrow
  1400.             Case Is = Left_Arrow: Redraw_Left_Arrow
  1401.             Case Is = Right_Arrow: Redraw_Right_Arrow
  1402.             Case Is = Down_Arrow: Redraw_Down_Arrow
  1403.         End Select
  1404.         '............................................................
  1405.         '>> Use GetPixel And SetPixel For Make Point's On FocusRect.
  1406.         '............................................................
  1407.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1408.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1409.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1410.                     For Fo.X = 3 To .ScaleWidth - 3 Step 2
  1411.                         For Fo.Y = 3 To .ScaleHeight - 3 Step 2
  1412.                             If GetPixel(.hdc, Fo.X, Fo.Y) = .ForeColor Then SetPixel .hdc, Fo.X, Fo.Y, vbBlack
  1413.                         Next Fo.Y: Next Fo.X
  1414.                     For Fo.X = 2 To .ScaleWidth - 2 Step 2
  1415.                         For Fo.Y = 2 To .ScaleHeight - 2 Step 2
  1416.                             If GetPixel(.hdc, Fo.X, Fo.Y) = .ForeColor Then SetPixel .hdc, Fo.X, Fo.Y, vbBlack
  1417.                         Next Fo.Y: Next Fo.X
  1418.                 End If
  1419.             End If
  1420.         End If
  1421.         '............................................................
  1422.         '>> Draw FocusRect Java About The Text.
  1423.         '............................................................
  1424.         If Len(mCaption) > 0 Then
  1425.             If mButtonStyle = Java And mFocusRect And mFocused Then
  1426.                 .ForeColor = BDR_FOCUSRECT_JAVA
  1427.                 RoundRect hdc, CaptionPos(1).X + CaptionPos(0).X + 2, CaptionPos(1).Y + CaptionPos(0).Y + 2, CaptionPos(0).X - 3, CaptionPos(0).Y - 2, 0, 0
  1428.             End If
  1429.         End If
  1430.         '............................................................
  1431.         '>> DropDown,Left DropDown,Right DropDown
  1432.         '............................................................
  1433.         Dim Flags(1)     As POINTAPI
  1434.         Select Case mDropDown
  1435.             Case Is = LeftDropDown
  1436.                 Flags(0).X = 2
  1437.                 Flags(0).Y = .ScaleHeight / 2 + Flags(0).Y / .ScaleHeight - 8
  1438.             Case Is = RightDropDown
  1439.                 Flags(0).X = .ScaleWidth - 21
  1440.                 Flags(0).Y = .ScaleHeight / 2 + Flags(0).Y / .ScaleHeight - 8
  1441.         End Select
  1442.         '............................................................
  1443.         '>> DropDown >> Left DropDown,Right DropDown
  1444.         '............................................................
  1445.         If Not mDropDown = None Then                       '>> So If mDropDown=LeftDropDown Or RightDropDown then
  1446.             .ForeColor = vbBlack                           '>> mForeColor If You Like.
  1447.             'Drwa Chevron
  1448.             MoveToEx .hdc, Flags(0).X + 6, Flags(0).Y + 5, Flags(1)
  1449.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 8
  1450.             LineTo .hdc, Flags(0).X + 13, Flags(0).Y + 4
  1451.             MoveToEx .hdc, Flags(0).X + 7, Flags(0).Y + 5, Flags(1)
  1452.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 7
  1453.             LineTo .hdc, Flags(0).X + 12, Flags(0).Y + 4
  1454.             MoveToEx .hdc, Flags(0).X + 6, Flags(0).Y + 9, Flags(1)
  1455.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 12
  1456.             LineTo .hdc, Flags(0).X + 13, Flags(0).Y + 8
  1457.             MoveToEx .hdc, Flags(0).X + 7, Flags(0).Y + 9, Flags(1)
  1458.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 11
  1459.             LineTo .hdc, Flags(0).X + 12, Flags(0).Y + 8
  1460.         End If
  1461.         .MaskPicture = .Image                              '>> Change ButtonStyleColor From Transparent To Opaque When Add Picture.
  1462.         .Refresh                                           '>> AutoRedraw=True
  1463.     End With
  1464. End Sub
  1465. Private Sub Redraw_Rectangle()
  1466.     Dim hRgn             As Long
  1467.     With UserControl
  1468.         '>> Rectangle >> Make Rectangle Shape.
  1469.         LineTo .hdc, 0, .ScaleHeight - 1
  1470.         LineTo .hdc, .ScaleWidth - 1, .ScaleHeight - 1
  1471.         LineTo .hdc, .ScaleWidth - 1, 0
  1472.         LineTo .hdc, 0, 0
  1473.         SetWindowRgn .hWnd, hRgn, False                    '>>Retune Original Shape To Button Without Cutting
  1474.         Select Case mButtonStyle
  1475.             Case Is = Visual                               '>> Rectangle >> Draw Visual Style.
  1476.                 If MouseDown Then
  1477.                     .ForeColor = BDR_VISUAL
  1478.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1479.                     LineTo .hdc, 0, 0
  1480.                     LineTo .hdc, 0, .ScaleHeight - 1
  1481.                     .ForeColor = BDR_VISUAL1
  1482.                     MoveToEx .hdc, .ScaleWidth - 1, 1, Lines
  1483.                     LineTo .hdc, 1, 1
  1484.                     LineTo .hdc, 1, .ScaleHeight - 1
  1485.                 Else
  1486.                     .ForeColor = BDR_VISUAL1
  1487.                     MoveToEx .hdc, .ScaleWidth - 2, 0, Lines
  1488.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1489.                     LineTo .hdc, 0, .ScaleHeight - 2
  1490.                     .ForeColor = BDR_VISUAL2
  1491.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1492.                     LineTo .hdc, 0, 0
  1493.                     LineTo .hdc, 0, .ScaleHeight - 1
  1494.                 End If
  1495.             Case Is = Flat                                 '>> Rectangle >> Draw Flat Style.
  1496.                 If MouseDown Then
  1497.                     .ForeColor = BDR_FLAT1
  1498.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1499.                     LineTo .hdc, 0, 0
  1500.                     LineTo .hdc, 0, .ScaleHeight - 1
  1501.                 Else
  1502.                     .ForeColor = BDR_FLAT2
  1503.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1504.                     LineTo .hdc, 0, 0
  1505.                     LineTo .hdc, 0, .ScaleHeight - 1
  1506.                 End If
  1507.             Case Is = OverFlat                             '>> Rectangle >> Draw OverFlat Style.
  1508.                 If MouseDown Then
  1509.                     .ForeColor = BDR_FLAT1
  1510.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1511.                     LineTo .hdc, 0, 0
  1512.                     LineTo .hdc, 0, .ScaleHeight - 1
  1513.                 ElseIf MouseMove Then
  1514.                     .ForeColor = BDR_FLAT2
  1515.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1516.                     LineTo .hdc, 0, 0
  1517.                     LineTo .hdc, 0, .ScaleHeight - 1
  1518.                 End If
  1519.             Case Is = Java                                 '>> Rectangle >> Draw Java Style.
  1520.                 If .Enabled Then
  1521.                     .ForeColor = BDR_JAVA1
  1522.                     MoveToEx .hdc, .ScaleWidth - 2, 1, Lines
  1523.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1524.                     LineTo .hdc, 2, .ScaleHeight - 2
  1525.                     .ForeColor = BDR_JAVA2
  1526.                     MoveToEx .hdc, .ScaleWidth - 1, 1, Lines
  1527.                     LineTo .hdc, 1, 1
  1528.                     LineTo .hdc, 1, .ScaleHeight - 1
  1529.                     LineTo .hdc, .ScaleWidth - 1, .ScaleHeight - 1
  1530.                     LineTo .hdc, .ScaleWidth - 1, 1
  1531.                 End If
  1532.             Case Is = WinXp                                '>> Rectangle >> Draw WindowsXp Style
  1533.                 If MouseDown Then
  1534.                     .ForeColor = BDR_PRESSED
  1535.                     MoveToEx .hdc, 2, .ScaleHeight - 3, Lines
  1536.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 3
  1537.                     LineTo .hdc, .ScaleWidth - 3, 2
  1538.                 ElseIf MouseMove Then
  1539.                     .ForeColor = BDR_GOLDXP_DARK
  1540.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight - 2, Lines
  1541.                     LineTo .hdc, 0, .ScaleHeight - 2
  1542.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1543.                     MoveToEx .hdc, 1, 1, Lines
  1544.                     LineTo .hdc, 1, .ScaleHeight - 3
  1545.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 3
  1546.                     LineTo .hdc, .ScaleWidth - 2, 1
  1547.                     .ForeColor = BDR_GOLDXP_NORMAL2
  1548.                     MoveToEx .hdc, 2, 2, Lines
  1549.                     LineTo .hdc, 2, .ScaleHeight - 3
  1550.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight - 4, Lines
  1551.                     LineTo .hdc, .ScaleWidth - 3, 2
  1552.                     .ForeColor = BDR_GOLDXP_LIGHT1
  1553.                     MoveToEx .hdc, 1, 1, Lines
  1554.                     LineTo .hdc, .ScaleWidth - 1, 1
  1555.                     .ForeColor = BDR_GOLDXP_LIGHT2
  1556.                     MoveToEx .hdc, 2, 2, Lines
  1557.                     LineTo .hdc, .ScaleWidth - 2, 2
  1558.                     '>> Rectangle >> Draw Xp FocusRect.
  1559.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  1560.                     .ForeColor = BDR_BLUEXP_DARK
  1561.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight - 2, Lines
  1562.                     LineTo .hdc, 0, .ScaleHeight - 2
  1563.                     .ForeColor = BDR_BLUEXP_NORMAL1
  1564.                     MoveToEx .hdc, 1, 1, Lines
  1565.                     LineTo .hdc, 1, .ScaleHeight - 3
  1566.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 3
  1567.                     LineTo .hdc, .ScaleWidth - 2, 1
  1568.                     .ForeColor = BDR_BLUEXP_NORMAL2
  1569.                     MoveToEx .hdc, 2, 2, Lines
  1570.                     LineTo .hdc, 2, .ScaleHeight - 3
  1571.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight - 4, Lines
  1572.                     LineTo .hdc, .ScaleWidth - 3, 2
  1573.                     .ForeColor = BDR_BLUEXP_LIGHT1
  1574.                     MoveToEx .hdc, 1, 1, Lines
  1575.                     LineTo .hdc, .ScaleWidth - 1, 1
  1576.                     .ForeColor = BDR_BLUEXP_LIGHT2
  1577.                     MoveToEx .hdc, 2, 2, Lines
  1578.                     LineTo .hdc, .ScaleWidth - 2, 2
  1579.                 End If
  1580.             Case Is = Vista    '>> Rectangle >> Draw Vista Style.
  1581.                 If MouseDown Then
  1582.                     .ForeColor = BDR_VISTA2
  1583.                     MoveToEx .hdc, 1, 1, Lines
  1584.                     LineTo .hdc, 1, .ScaleHeight - 2
  1585.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1586.                     LineTo .hdc, .ScaleWidth - 2, 1
  1587.                     LineTo .hdc, 1, 1
  1588.                 Else
  1589.                     .ForeColor = BDR_VISTA1
  1590.                     MoveToEx .hdc, 1, 1, Lines
  1591.                     LineTo .hdc, 1, .ScaleHeight - 2
  1592.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1593.                     LineTo .hdc, .ScaleWidth - 2, 1
  1594.                     LineTo .hdc, 1, 1
  1595.                     '>> Rectangle >> Draw Vista FocusRect.
  1596.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  1597.                         .ForeColor = BDR_FOCUSRECT_VISTA
  1598.                         MoveToEx .hdc, 1, 1, Lines
  1599.                         LineTo .hdc, 1, .ScaleHeight - 2
  1600.                         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1601.                         LineTo .hdc, .ScaleWidth - 2, 1
  1602.                         LineTo .hdc, 1, 1
  1603.                     End If
  1604.                 End If
  1605.         End Select
  1606.         '>> Rectangle >> Draw FocusRect.
  1607.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1608.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1609.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1610.                     .ForeColor = BDR_FOCUSRECT
  1611.                     MoveToEx .hdc, 4, 4, Lines
  1612.                     LineTo .hdc, 4, .ScaleHeight - 5
  1613.                     LineTo .hdc, .ScaleWidth - 5, .ScaleHeight - 5
  1614.                     LineTo .hdc, .ScaleWidth - 5, 4
  1615.                     LineTo .hdc, 4, 4
  1616.                 End If
  1617.             End If
  1618.         End If
  1619.     End With
  1620. End Sub
  1621. Private Sub Redraw_RoundedRectangle()
  1622.     With UserControl
  1623.         '>> RoundedRectangle >> Make RoundedRectangle Shape.
  1624.         hRgn = CreateRoundRectRgn(0, 0, .ScaleWidth, .ScaleHeight, 15, 15)
  1625.         SetWindowRgn .hWnd, hRgn, True
  1626.         DeleteObject hRgn
  1627.  
  1628.         '>> RoundedRectangle >> Draw RoundedRectangle Shape.
  1629.         RoundRect hdc, 0, 0, .ScaleWidth - 1, .ScaleHeight - 1, 16, 16
  1630.  
  1631.         Select Case mButtonStyle
  1632.             Case Is = Visual                               '>> RoundedRectangle >> Draw Visual Style.
  1633.                 If MouseDown Then
  1634.                     .ForeColor = BDR_VISUAL
  1635.                     MoveToEx .hdc, 10, 0, Lines
  1636.                     LineTo .hdc, .ScaleWidth - 8, 0
  1637.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1638.                     MoveToEx .hdc, 0, 10, Lines
  1639.                     LineTo .hdc, 0, .ScaleHeight - 10
  1640.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight
  1641.                     Arc .hdc, 16, .ScaleHeight - 16, 0, .ScaleHeight - 2, -16, .ScaleHeight - 16, 8, .ScaleHeight
  1642.                     .ForeColor = BDR_VISUAL1
  1643.                     MoveToEx .hdc, 10, 1, Lines
  1644.                     LineTo .hdc, .ScaleWidth - 8, 1
  1645.                     Arc .hdc, 17, 17, 1, 1, 10, 1, 1, 10
  1646.                     MoveToEx .hdc, 1, 10, Lines
  1647.                     LineTo .hdc, 1, .ScaleHeight - 10
  1648.                     Arc .hdc, 17, .ScaleHeight - 16, 1, .ScaleHeight - 2, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1649.                 Else
  1650.                     .ForeColor = BDR_VISUAL1
  1651.                     RoundRect hdc, 0, 0, .ScaleWidth - 2, .ScaleHeight - 2, 15, 15
  1652.                     .ForeColor = BDR_VISUAL2
  1653.                     MoveToEx .hdc, 10, 0, Lines
  1654.                     LineTo .hdc, .ScaleWidth - 8, 0
  1655.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1656.                     MoveToEx .hdc, 0, 10, Lines
  1657.                     LineTo .hdc, 0, .ScaleHeight - 10
  1658.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 2, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1659.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1660.                 End If
  1661.             Case Is = Flat                                 '>> RoundedRectangle >> Draw Flat Style.
  1662.                 If MouseDown Then
  1663.                     .ForeColor = BDR_FLAT1
  1664.                     MoveToEx .hdc, 10, 0, Lines
  1665.                     LineTo .hdc, .ScaleWidth - 8, 0
  1666.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1667.                     MoveToEx .hdc, 0, 10, Lines
  1668.                     LineTo .hdc, 0, .ScaleHeight - 10
  1669.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1670.                 Else
  1671.                     .ForeColor = BDR_FLAT2
  1672.                     MoveToEx .hdc, 10, 0, Lines
  1673.                     LineTo .hdc, .ScaleWidth - 8, 0
  1674.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1675.                     MoveToEx .hdc, 0, 10, Lines
  1676.                     LineTo .hdc, 0, .ScaleHeight - 10
  1677.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1678.                 End If
  1679.             Case Is = OverFlat                             '>> RoundedRectangle >> Draw OverFlat Style.
  1680.                 If MouseDown Then
  1681.                     .ForeColor = BDR_FLAT1
  1682.                     MoveToEx .hdc, 10, 0, Lines
  1683.                     LineTo .hdc, .ScaleWidth - 8, 0
  1684.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1685.                     MoveToEx .hdc, 0, 10, Lines
  1686.                     LineTo .hdc, 0, .ScaleHeight - 10
  1687.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1688.                 ElseIf MouseMove Then
  1689.                     .ForeColor = BDR_FLAT2
  1690.                     MoveToEx .hdc, 10, 0, Lines
  1691.                     LineTo .hdc, .ScaleWidth - 8, 0
  1692.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1693.                     MoveToEx .hdc, 0, 10, Lines
  1694.                     LineTo .hdc, 0, .ScaleHeight - 10
  1695.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1696.                 End If
  1697.             Case Is = Java                                 '>> RoundedRectangle >> Draw Java Style.
  1698.                 If .Enabled Then
  1699.                     .ForeColor = BDR_JAVA1
  1700.                     RoundRect hdc, 0, 0, .ScaleWidth - 2, .ScaleHeight - 2, 16, 16
  1701.                     .ForeColor = BDR_JAVA2
  1702.                     RoundRect hdc, 1, 1, .ScaleWidth - 1, .ScaleHeight - 1, 16, 16
  1703.                 End If
  1704.             Case Is = WinXp                                '>> RoundedRectangle >> Draw WindowsXp Style.
  1705.                 If MouseDown Then
  1706.                     .ForeColor = BDR_PRESSED
  1707.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 10, .ScaleHeight - 3, .ScaleWidth - 2, .ScaleHeight - 10
  1708.                     MoveToEx .hdc, .ScaleWidth - 9, .ScaleHeight - 4, Lines
  1709.                     LineTo .hdc, 8, .ScaleHeight - 4
  1710.                     MoveToEx .hdc, .ScaleWidth - 4, 4, Lines
  1711.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight - 9
  1712.                 ElseIf MouseMove Then
  1713.                     .ForeColor = BDR_GOLDXP_DARK
  1714.                     Arc .hdc, 16, .ScaleHeight - 17, 1, .ScaleHeight - 2, -17, .ScaleHeight, 8, .ScaleHeight - 1
  1715.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 3, Lines
  1716.                     LineTo .hdc, 8, .ScaleHeight - 3
  1717.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 2, .ScaleHeight - 2, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1718.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1719.                     Arc .hdc, 17, .ScaleHeight - 18, 1, .ScaleHeight - 3, -18, .ScaleHeight, 10, .ScaleHeight - 1
  1720.                     MoveToEx .hdc, 1, 6, Lines
  1721.                     LineTo .hdc, 1, .ScaleHeight - 8
  1722.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 4, Lines
  1723.                     LineTo .hdc, 8, .ScaleHeight - 4
  1724.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1725.                     MoveToEx .hdc, .ScaleWidth - 3, 6, Lines
  1726.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 8
  1727.                     .ForeColor = BDR_GOLDXP_NORMAL2
  1728.                     MoveToEx .hdc, 2, 7, Lines
  1729.                     LineTo .hdc, 2, .ScaleHeight - 7
  1730.                     MoveToEx .hdc, .ScaleWidth - 4, 7, Lines
  1731.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight - 7
  1732.                     Arc .hdc, 17, 17, 1, 1, 8, 0, 0, 8
  1733.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 2, 1, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1734.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 3, 2, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1735.                     Arc .hdc, 17, 17, 2, 2, 8, 0, 0, 8
  1736.                     .ForeColor = BDR_GOLDXP_LIGHT1
  1737.                     MoveToEx .hdc, 10, 1, Lines
  1738.                     LineTo .hdc, .ScaleWidth - 7, 1
  1739.                     .ForeColor = BDR_GOLDXP_LIGHT2
  1740.                     MoveToEx .hdc, 10, 2, Lines
  1741.                     LineTo .hdc, .ScaleWidth - 8, 2
  1742.                     '>> RoundedRectangle >> Draw Xp FocusRect.
  1743.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  1744.                     .ForeColor = BDR_BLUEXP_DARK
  1745.                     Arc .hdc, 16, .ScaleHeight - 17, 1, .ScaleHeight - 2, -17, .ScaleHeight, 8, .ScaleHeight - 1
  1746.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 3, Lines
  1747.                     LineTo .hdc, 8, .ScaleHeight - 3
  1748.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 2, .ScaleHeight - 2, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1749.                     .ForeColor = BDR_BLUEXP_NORMAL1
  1750.                     Arc .hdc, 17, .ScaleHeight - 18, 1, .ScaleHeight - 3, -18, .ScaleHeight, 10, .ScaleHeight
  1751.                     MoveToEx .hdc, 1, 6, Lines
  1752.                     LineTo .hdc, 1, .ScaleHeight - 8
  1753.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 4, Lines
  1754.                     LineTo .hdc, 8, .ScaleHeight - 4
  1755.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1756.                     MoveToEx .hdc, .ScaleWidth - 3, 6, Lines
  1757.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 8
  1758.                     .ForeColor = BDR_BLUEXP_NORMAL2
  1759.                     MoveToEx .hdc, 2, 7, Lines
  1760.                     LineTo .hdc, 2, .ScaleHeight - 7
  1761.                     MoveToEx .hdc, .ScaleWidth - 4, 7, Lines
  1762.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight - 7
  1763.                     Arc .hdc, 17, 17, 1, 1, 8, 0, 0, 8
  1764.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 2, 1, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1765.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 3, 2, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1766.                     Arc .hdc, 17, 17, 2, 2, 8, 0, 0, 8
  1767.                     .ForeColor = BDR_BLUEXP_LIGHT1
  1768.                     MoveToEx .hdc, 10, 1, Lines
  1769.                     LineTo .hdc, .ScaleWidth - 7, 1
  1770.                     .ForeColor = BDR_BLUEXP_LIGHT2
  1771.                     MoveToEx .hdc, 10, 2, Lines
  1772.                     LineTo .hdc, .ScaleWidth - 8, 2
  1773.                 End If
  1774.             Case Is = Vista    '>> RoundedRectangle >> Draw Vista Style.
  1775.                 If MouseDown Then
  1776.                     .ForeColor = BDR_VISTA2
  1777.                     RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, 14, 14
  1778.                 Else
  1779.                     .ForeColor = BDR_VISTA1
  1780.                     RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, 14, 14
  1781.                     '>> RoundedRectangle >> Draw Vista FocusRect.
  1782.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  1783.                         .ForeColor = BDR_FOCUSRECT_VISTA
  1784.                         RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, 14, 14
  1785.                     End If
  1786.                 End If
  1787.         End Select
  1788.         '>> RoundedRectangle >> Draw FocusRect.
  1789.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1790.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1791.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1792.                     .ForeColor = BDR_FOCUSRECT
  1793.                     RoundRect .hdc, 4, 4, .ScaleWidth - 5, .ScaleHeight - 5, 15, 15
  1794.                 End If
  1795.             End If
  1796.         End If
  1797.     End With
  1798. End Sub
  1799. Private Sub Redraw_Round()
  1800.     With UserControl
  1801.         '>> Round >> Make Round Shape.
  1802.         'hRgn = CreateRoundRectRgn(0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth , .ScaleHeight )
  1803.         hRgn = CreateEllipticRgn(0, 0, .ScaleWidth, .ScaleHeight)
  1804.         SetWindowRgn .hWnd, hRgn, True
  1805.         DeleteObject hRgn
  1806.  
  1807.         '>> Round >> Draw Round Shape.
  1808.         RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, .ScaleWidth - 2, .ScaleHeight - 2
  1809.  
  1810.         Select Case mButtonStyle
  1811.             Case Is = Visual                               '>> Round >> Draw Visual Style.
  1812.                 If MouseDown Then
  1813.                     .ForeColor = BDR_VISUAL
  1814.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1815.                     .ForeColor = BDR_VISUAL1
  1816.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth - 3, 2, 2, .ScaleHeight - 3
  1817.                 Else
  1818.                     .ForeColor = BDR_VISUAL1
  1819.                     Arc .hdc, 1, 1, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth / 3, .ScaleHeight / 2, .ScaleWidth - 3, 1
  1820.                     .ForeColor = BDR_VISUAL2
  1821.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1822.                 End If
  1823.             Case Is = Flat                                 '>> Round >> Draw Flat Style.
  1824.                 If MouseDown Then
  1825.                     .ForeColor = BDR_FLAT1
  1826.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1827.                 Else
  1828.                     .ForeColor = BDR_FLAT2
  1829.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1830.                 End If
  1831.             Case Is = OverFlat                             '>> Round >> Draw OverFlat Style.
  1832.                 If MouseDown Then
  1833.                     .ForeColor = BDR_FLAT1
  1834.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1835.                 ElseIf MouseMove Then
  1836.                     .ForeColor = BDR_FLAT2
  1837.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1838.                 End If
  1839.             Case Is = Java                                 '>> Round >> Draw Java Style.
  1840.                 If .Enabled Then
  1841.                     .ForeColor = BDR_JAVA1
  1842.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth / 2, .ScaleHeight - 3, .ScaleWidth / 2, 3
  1843.                     .ForeColor = BDR_JAVA2
  1844.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth / 2, 2, .ScaleWidth / 2, .ScaleHeight - 2
  1845.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 2
  1846.                 End If
  1847.             Case Is = WinXp                                '>> Round >> Draw WindowsXp Style.
  1848.                 If MouseDown Then
  1849.                     .ForeColor = BDR_PRESSED
  1850.                     Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 3
  1851.                 ElseIf MouseMove Then
  1852.                     .ForeColor = BDR_GOLDXP_DARK
  1853.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, 2, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1854.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1855.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 4, 3, 3, .ScaleWidth - 2, 4
  1856.                     .ForeColor = BDR_GOLDXP_NORMAL2
  1857.                     Arc .hdc, 3, 3, .ScaleWidth - 4, .ScaleHeight - 3, 2, 3, .ScaleWidth - 2, 3
  1858.                     .ForeColor = BDR_GOLDXP_LIGHT1
  1859.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 2, 2, 2, .ScaleWidth - 3, 3, 3, 3
  1860.                     .ForeColor = BDR_GOLDXP_LIGHT2
  1861.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 3, 3, .ScaleWidth - 3, 4, 4, 4
  1862.                     '>> Round >> Draw Xp FocusRect.
  1863.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  1864.                     .ForeColor = BDR_BLUEXP_DARK
  1865.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, 2, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1866.                     .ForeColor = BDR_BLUEXP_NORMAL1
  1867.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 4, 3, 3, .ScaleWidth - 2, 4
  1868.                     .ForeColor = BDR_BLUEXP_NORMAL2
  1869.                     Arc .hdc, 3, 3, .ScaleWidth - 4, .ScaleHeight - 3, 2, 3, .ScaleWidth - 2, 3
  1870.                     .ForeColor = BDR_BLUEXP_LIGHT1
  1871.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 2, 2, 2, .ScaleWidth - 3, 3, 3, 3
  1872.                     .ForeColor = BDR_BLUEXP_LIGHT2
  1873.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 3, 3, .ScaleWidth - 3, 4, 4, 4
  1874.                 End If
  1875.             Case Is = Vista    '>> Round >> Draw Vista Style.
  1876.                 If MouseDown Then
  1877.                     .ForeColor = BDR_VISTA2
  1878.                     RoundRect hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1879.                 Else
  1880.                     .ForeColor = BDR_VISTA1
  1881.                     RoundRect hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1882.                     '>> Round >> Draw Vista FocusRect.
  1883.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  1884.                         .ForeColor = BDR_FOCUSRECT_VISTA
  1885.                         RoundRect hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1886.                     End If
  1887.                 End If
  1888.         End Select
  1889.         '>> Round >> Draw FocusRect.
  1890.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1891.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1892.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1893.                     .ForeColor = BDR_FOCUSRECT
  1894.                     RoundRect hdc, 4, 4, .ScaleWidth - 5, .ScaleHeight - 5, .ScaleWidth - 5, .ScaleHeight - 5
  1895.                 End If
  1896.             End If
  1897.         End If
  1898.     End With
  1899. End Sub
  1900. Private Sub Redraw_Diamond()
  1901.     With UserControl
  1902.         '>> Diamond >> Make Diamond Shape.
  1903.         P(0).X = .ScaleWidth: P(0).Y = .ScaleHeight / 2
  1904.         P(1).X = .ScaleWidth / 2: P(1).Y = 0
  1905.         P(2).X = 0: P(2).Y = .ScaleHeight / 2
  1906.         P(3).X = .ScaleWidth / 2: P(3).Y = .ScaleHeight
  1907.         hRgn = CreatePolygonRgn(P(0), &H4, WINDING)
  1908.         SetWindowRgn .hWnd, hRgn, True
  1909.         DeleteObject hRgn
  1910.  
  1911.         '>> Diamond >> Draw Diamond Shape.
  1912.         MoveToEx .hdc, 0, .ScaleHeight / 2, Lines
  1913.         LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1914.         LineTo .hdc, .ScaleWidth - 1, .ScaleHeight / 2
  1915.         LineTo .hdc, .ScaleWidth / 2, 0
  1916.         LineTo .hdc, 0, .ScaleHeight / 2
  1917.         If Not mButtonStyleColors = Transparent Then
  1918.             MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1919.             LineTo .hdc, .ScaleWidth / 2, 0
  1920.         End If
  1921.         Select Case mButtonStyle
  1922.             Case Is = Visual                               '>> Diamond >> Draw Visual Style.
  1923.                 If MouseDown Then
  1924.                     .ForeColor = BDR_VISUAL
  1925.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1926.                     LineTo .hdc, 0, .ScaleHeight / 2
  1927.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1928.                     .ForeColor = BDR_VISUAL1
  1929.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1930.                     LineTo .hdc, 1, .ScaleHeight / 2
  1931.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1932.                 Else
  1933.                     .ForeColor = BDR_VISUAL1
  1934.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  1935.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  1936.                     LineTo .hdc, .ScaleWidth / 2, 1
  1937.                     .ForeColor = BDR_VISUAL2
  1938.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1939.                     LineTo .hdc, 0, .ScaleHeight / 2
  1940.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1941.                 End If
  1942.             Case Is = Flat                                 '>> Diamond >> Draw Flat Style.
  1943.                 If MouseDown Then
  1944.                     .ForeColor = BDR_FLAT1
  1945.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1946.                     LineTo .hdc, 0, .ScaleHeight / 2
  1947.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1948.                 Else
  1949.                     .ForeColor = BDR_FLAT2
  1950.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1951.                     LineTo .hdc, 0, .ScaleHeight / 2
  1952.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1953.                 End If
  1954.             Case Is = OverFlat                             '>> Diamond >> Draw OverFlat Style.
  1955.                 If MouseDown Then
  1956.                     .ForeColor = BDR_FLAT1
  1957.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1958.                     LineTo .hdc, 0, .ScaleHeight / 2
  1959.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1960.                 ElseIf MouseMove Then
  1961.                     .ForeColor = BDR_FLAT2
  1962.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1963.                     LineTo .hdc, 0, .ScaleHeight / 2
  1964.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1965.                 End If
  1966.             Case Is = Java                                 '>> Diamond >> Draw Java Style.
  1967.                 If .Enabled Then
  1968.                     .ForeColor = BDR_JAVA1
  1969.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1970.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  1971.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1972.                     .ForeColor = BDR_JAVA2
  1973.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1974.                     LineTo .hdc, 1, .ScaleHeight / 2
  1975.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1976.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1977.                     LineTo .hdc, .ScaleWidth - 1, .ScaleHeight / 2
  1978.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1979.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1980.                 End If
  1981.             Case Is = WinXp                                '>> Diamond >> Draw WindowsXp Style.
  1982.                 If MouseDown Then
  1983.                     .ForeColor = BDR_PRESSED
  1984.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 4, Lines
  1985.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight / 2
  1986.                     LineTo .hdc, .ScaleWidth / 2, 3
  1987.                     SetPixel .hdc, .ScaleWidth / 2, 1, vbBlack
  1988.                 ElseIf MouseMove Then
  1989.                     .ForeColor = BDR_GOLDXP_DARK
  1990.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  1991.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  1992.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1993.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 3, Lines
  1994.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight / 2
  1995.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  1996.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1997.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  1998.                     LineTo .hdc, .ScaleWidth / 2, 1
  1999.                     .ForeColor = BDR_GOLDXP_NORMAL2
  2000.                     MoveToEx .hdc, 2, .ScaleHeight / 2, Lines
  2001.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 3
  2002.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight / 2, Lines
  2003.                     LineTo .hdc, .ScaleWidth / 2, 2
  2004.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2005.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2006.                     LineTo .hdc, 1, .ScaleHeight / 2
  2007.                     .ForeColor = BDR_GOLDXP_LIGHT2
  2008.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2009.                     LineTo .hdc, 2, .ScaleHeight / 2
  2010.                     SetPixel .hdc, .ScaleWidth / 2, 1, vbBlack
  2011.                     '>> Diamond >> Draw Xp FocusRect.
  2012.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  2013.                     .ForeColor = BDR_BLUEXP_DARK
  2014.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  2015.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2016.                     .ForeColor = BDR_BLUEXP_NORMAL1
  2017.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 3, Lines
  2018.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight / 2
  2019.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2020.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2021.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  2022.                     LineTo .hdc, .ScaleWidth / 2, 1
  2023.                     .ForeColor = BDR_BLUEXP_NORMAL2
  2024.                     MoveToEx .hdc, 2, .ScaleHeight / 2, Lines
  2025.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 3
  2026.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight / 2, Lines
  2027.                     LineTo .hdc, .ScaleWidth / 2, 2
  2028.                     .ForeColor = BDR_BLUEXP_LIGHT1
  2029.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2030.                     LineTo .hdc, 1, .ScaleHeight / 2
  2031.                     .ForeColor = BDR_BLUEXP_LIGHT2
  2032.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2033.                     LineTo .hdc, 2, .ScaleHeight / 2
  2034.                     SetPixel .hdc, .ScaleWidth / 2, 1, vbBlack
  2035.                 End If
  2036.             Case Is = Vista    '>> Diamond >> Draw Vista Style.
  2037.                 If MouseDown Then
  2038.                     .ForeColor = BDR_VISTA2
  2039.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2040.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2041.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2042.                     LineTo .hdc, .ScaleWidth / 2, 1
  2043.                     LineTo .hdc, 1, .ScaleHeight / 2
  2044.                 Else
  2045.                     .ForeColor = BDR_VISTA1
  2046.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2047.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2048.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2049.                     LineTo .hdc, .ScaleWidth / 2, 1
  2050.                     LineTo .hdc, 1, .ScaleHeight / 2
  2051.                     '>> Diamond >> Draw Vista FocusRect.
  2052.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  2053.                         .ForeColor = BDR_FOCUSRECT_VISTA
  2054.                         MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2055.                         LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2056.                         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2057.                         LineTo .hdc, .ScaleWidth / 2, 1
  2058.                         LineTo .hdc, 1, .ScaleHeight / 2
  2059.                     End If
  2060.                 End If
  2061.         End Select
  2062.         '>> Diamond >> Draw FocusRect.
  2063.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  2064.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  2065.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  2066.                     .ForeColor = BDR_FOCUSRECT
  2067.                     PL(0).X = .ScaleWidth - 6: PL(0).Y = .ScaleHeight / 2
  2068.                     PL(1).X = .ScaleWidth / 2: PL(1).Y = 5
  2069.                     PL(2).X = 5: PL(2).Y = .ScaleHeight / 2
  2070.                     PL(3).X = .ScaleWidth / 2: PL(3).Y = .ScaleHeight - 6
  2071.                     Polygon .hdc, PL(0), &H4
  2072.                     '>> Return FocusRect For Good Show.
  2073.                     For Fo.X = 2 To .ScaleWidth - 2 Step 1
  2074.                         For Fo.Y = 1 To .ScaleHeight - 1 Step 2
  2075.                             If GetPixel(.hdc, Fo.X, Fo.Y) = .ForeColor Then SetPixel .hdc, Fo.X, Fo.Y, vbBlack
  2076.                         Next Fo.Y
  2077.                     Next Fo.X
  2078.                 End If
  2079.             End If
  2080.         End If
  2081.     End With
  2082. End Sub
  2083. Private Sub Redraw_Top_Triangle()
  2084.     With UserControl
  2085.         '>> Top_Triangle >> Make Top_Triangle Shape.
  2086.         P(0).X = 0: P(0).Y = .ScaleHeight
  2087.         P(1).X = .ScaleWidth / 2: P(1).Y = 0
  2088.         P(2).X = .ScaleWidth: P(2).Y = .ScaleHeight
  2089.         hRgn = CreatePolygonRgn(P(0), &H3, WINDING)
  2090.         SetWindowRgn .hWnd, hRgn, True
  2091.         DeleteObject hRgn
  2092.  
  2093.         '>> Top_Triangle >> Draw Top_Triangle Shape.
  2094.         MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2095.         LineTo .hdc, 1, .ScaleHeight - 1
  2096.         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 1
  2097.         LineTo .hdc, .ScaleWidth / 2, 1
  2098.  
  2099.         Select Case mButtonStyle
  2100.             Case Is = Visual                               '>> Top_Triangle >> Draw Visual Style.
  2101.                 If MouseDown Then
  2102.                     .ForeColor = BDR_VISUAL
  2103.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2104.                     LineTo .hdc, 1, .ScaleHeight - 1
  2105.                     .ForeColor = BDR_VISUAL1
  2106.                     MoveToEx .hdc, .ScaleWidth / 2, 3, Lines
  2107.                     LineTo .hdc, 3, .ScaleHeight - 3
  2108.                 Else
  2109.                     .ForeColor = BDR_VISUAL1
  2110.                     MoveToEx .hdc, 1, .ScaleHeight - 2, Lines
  2111.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 2
  2112.                     LineTo .hdc, .ScaleWidth / 2, 3
  2113.                     .ForeColor = BDR_VISUAL2
  2114.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2115.                     LineTo .hdc, 1, .ScaleHeight - 1
  2116.                 End If
  2117.             Case Is = Flat                                 '>> Top_Triangle >> Draw Flat Style.
  2118.                 If MouseDown Then
  2119.                     .ForeColor = BDR_FLAT1
  2120.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2121.                     LineTo .hdc, 1, .ScaleHeight - 1
  2122.                 Else
  2123.                     .ForeColor = BDR_FLAT2
  2124.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2125.                     LineTo .hdc, 1, .ScaleHeight - 1
  2126.                 End If
  2127.             Case Is = OverFlat                             '>> Top_Triangle >> Draw OverFlat Style.
  2128.                 If MouseDown Then
  2129.                     .ForeColor = BDR_FLAT1
  2130.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2131.                     LineTo .hdc, 1, .ScaleHeight - 1
  2132.                 ElseIf MouseMove Then
  2133.                     .ForeColor = BDR_FLAT2
  2134.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2135.                     LineTo .hdc, 1, .ScaleHeight - 1
  2136.                 End If
  2137.             Case Is = Java                                 '>> Top_Triangle >> Draw Java Style.
  2138.                 If .Enabled Then
  2139.                     .ForeColor = BDR_JAVA1
  2140.                     MoveToEx .hdc, 1, .ScaleHeight - 2, Lines
  2141.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 2
  2142.                     LineTo .hdc, .ScaleWidth / 2, 3
  2143.                     .ForeColor = BDR_JAVA2
  2144.                     MoveToEx .hdc, .ScaleWidth / 2, 3, Lines
  2145.                     LineTo .hdc, 2, .ScaleHeight - 1
  2146.                     MoveToEx .hdc, 2, .ScaleHeight - 1, Lines
  2147.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight = Flat                                 '>> Diamond >> DcaleHeight = Flat dth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth - 3, 2, 2, .ScaleHeightidth - 3, 2, 2, .ScaleHeightidth - 3, 2, 2, .ScaleHeightidth - 3, 2, 2, 2, .Sca           End If
  2148.                 End      MoveToEx .hdc, .ScaleWidth th - 3, .ScaleHeight - 2
  2149.                     LineTo .hdc, .ScaleWidth / 2, 3
  2150.                     .ForeColor = BDR_JAVA2
  2151.                     MoveToEx .hdc,     .ForeColor = BDR_JAVA2
  2152.                     MoveToEx .hdc,     .ForeColor = BDR_JAVA2
  2153.                      '>> Top_Trianangle               VetP                  .ForeColor = BDR_FLAT2
  2154.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  2155.                     LineTo .hdc, 0, .ScaleHeight / 2
  2156.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  2157.                 End If
  2158.         C  MoveHeight / 2
  2159.         P(1).X = .ScaleP               o .hdc, 1, .ScaleHei   MoveToEx .hdc    LineTo .hdc, .ineTo .hdc, .ineTohA PL(Y                                '>>                 MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Dale   '>>                 MoveToEx .hdc, .ScaleWveToEx .hdc            MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  2160.                     LineTo .hdc, 0, .Scale5caleHeight -Ex .eTo .hdc, .ineTohA PL(Y   iGFt - 1
  2161.                 El     Arc .hdc, .Scale/aineTohA PL( Case mButtonStyleNeToh, Lines
  2162.          8p Lines
  2163.        9dmM   8p Lines
  2164.   dc, .ineTohA PL(Y   iGFt - 1
  2165.                 El     Arc .hdc, .S     xht - 3
  2166.                     '>> Round >> Draw Vista FocusRleH001ght / 2
  2167.         P(1).X = .ScaleP               o          oa    Y       P(1Dale   '>>            >> Top_Triangle >> Draw OverFlat Style.
  2168.                 If MouseDo    1p  '>>            >> Top_Triooa     = .ScaleP  oOoa     = .ScaleP  oOoa     = caleWidth / 2, .ScaleHeToh, Lines
  2169.      .X = 0idth / 2, 3
  2170.      = .eeee = Java       O     .X = 0idth /  - 2, .S oleHeTo2, .S oleHeTo2, .S oleHeTo2, .S oleHeTo2, .S FeHeToh, LX = 0idth    = caleWidth / 2      MveTo .hdc, .ScaleWi.
  2171.                 If MouseDo    nd nes
  2172.                     LineTo .hdc, 3, .ScaleHeight - 3
  2173.                 Else
  2174.                     I8Y = .Scal1ght /va                                                                                                                                     3used Then           .ScaleP  oOoa     = caleWidth / 2, .ScaleHeToh, Lines
  2175.      .X = 0idtdth / 2, 3
  2176.             BO          3used Then          = .ScaleP 3
  2177.     Scalew
  2178.                     LineTo .hdc, .ScaleWidth - 2      eTohA PL(Y               o .hdc, .ScaleWidth - dth - 2  4al1ght /va                                                                    d                                            d                                            d                                            d                             d                                   
  2179.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight /CH           .ForeColor HeTo2, LineTo .hdc, 3, .ScaleHeight - 3
  2180.                 Elssssssssssssss      LineTo .hdc, .ScaleWidth / 2, 3
  2181.                     .ForeColor = BDR_JAVA2
  2182.                     MoveToEx .hdc,     .ForeColor = BDR_JAVA2
  2183.                     MoveToEx .hdc,     .ForeColor = BDR_JA)leHeTo2       '>> Top_T                  d                                            d    rOolor =np
  2184.              2, 3oreCooEx .hdc, 10, 0, Lines
  2185.                   .ForeColor = BDR_JAVA2
  2186.                     MoveToEx .hdc, .     BO = BDR_JR_BLUEX             LaScal1ght /va      leHeight / 2
  2187.  EX             YYYYYYYYYYYYYYYleWidth - 2      eTohA PL YYYYYYYYYYY
  2188.  
  2189.         '>> Top_o.Y = 1 T    Y
  2190. AsFFFFFFFFFFFFFFFTop_o.Y = 1 TL YYYYYYYYYYY
  2191.  
  2192.         '>> Top_o.Y = 1 T    Y
  2193. AsFFFFFFFFFFFFFFFTopop_o.Y = 1 TL YYYY, .ScaleWidth - 3, .S Y
  2194. empop_o.Y = 1 TL YYYY, .ScaleWidth - 3,lYYYYY    eTohA PL YYYYYn       YYYYYYYYYYYYYYYleWidth - 2 dc, .ScaleWidth / 2, 2, Lines
  2195.          FneTo        YYYYn       YYYYYYYYYYYYYYYleWidth - 2 dc, .ScaleWidth / 2, 2, Lines
  2196.          FneTo        YYYYn       YYYYYYYYYYYYYYYleWidth - 2 dc, .ScaleWidth / 2, 2, Lines
  2197.          FneTo        YYYYn       YYYYYYYYYYYYYYYleWidth - 2 dc, .ScaleWidth / 2, 2, Lines
  2198.     k                   LineTo 1 3
  2199.                 Else
  2200.                     .ForeColor = BDR_VISUAL1
  2201.             3
  2202.                 Else
  2203.                     .ForeColor = BDR_VISUAL1
  2204.             3
  2205.         3
  2206.      Else
  2207.            lor =0So                   3
  2208.         3
  2209.      Else
  2210.            lor =0So           FneTo        YYYYn       YYYYYYYYYYYYYYYleWidth - 2 dc, .ScaleWidYeWidth - 2 dc, .ScCuseMocaleWidth - 4, .ScaleHeior =0So           FneTo oEx .hdc,      ci10, 0, Lines
  2211.           dth / 2, .ScaleHeight - 2, Lines
  2212.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2213.                     .ForeColorh, LX = 0idth                            ycaleHes
  2214.           4, .S  3
  2215.  _3n1BDR_VISUAL2
  2216.   YYYYYlse
  2217.            lor =0So           Ff
  2218.    lor =0SoD3 .hdc, 17, 17, 2, 2, 8, 0, 0, 8
  2219.                     .ForeColor = BDR_BLUEXP_LIGHT1
  2220.                     MoveToEx .hdc, 10, 1, Lines
  2221.                     LineTo .hdc, .ScaleWidth - 7, 1
  2222.                     .ForeCole()
  2223.         )ht
  2224.         hRgn = CreatePolygonR  .ForeC                         '>> Top_Triangle >> Draw Flat Style.
  2225.                 I - 3
  2226.                 Else
  2227.                     .ForeColor = BDR_VISUAL1
  2228.                     MoveToEx .hdc, 1, .ScaleHA          lor =0So        .hdc, 1, .ScaleHUEX.hdc, 10, 1, Lines
  2229.       THT1
  2230.                     MoveToEx .hdc, 10, 1, Lines
  2231.        es
  2232.       THT1
  2233.                 T, 10, 1, Lines
  2234.        es
  2235.       THT1
  2236.                 T, 10, 1, Lines
  2237.        es
  2238.       THT1
  2239.                                              i        .oYYYYYYYY    iR = caleWidth / 2            sn     tVISUA
  2240.       THT1
  2241.      S.ar  i        .oYYYYopight / 2
  2242.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  2243.      .D       LineTo .hdc, .ScaleWidth /c, .Height - 2
  2244.  
  2245.         Select CaseLrc .1
  2246.             1
  2247.                     .ForeCole()
  2248.                      Height /             .ForeColo        3c, 1, .ScaleHeight - 1
  2249.                 End IfineTo .hdc, .Sca          Rdth / 2, .ScaleHeight - 2, Lines
  2250.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2251.        Yopight / 2
  2252.                          t / dth - 2, .ScaleHeight /CH           .ForeColor HeTo2, LineTo .hdc, 3, .ScaleHeight - 3
  2253.                 Elssssssssssssss      LineTo .hdc, .t -eight - Height - 3
  2254.                 Elssssssssssssss      LineTo .hdc, .t -eight - Height - 3
  2255.                 ElssssssssssssssmreColor YYYY, .          Case Is = OverFlat                             '>oreC    LineTo .hdc, .t -eigveToEx .hdc, 1, .ScaleHA        YYYYn      He.ForR_BLUEXP_ 2, .ScaleHIE10, 1, Lines
  2256.       THT1
  2257.      c, 1, .ScaleHeightOndRect hdc, 2, 2,hdc, .ScaleWidth /c, .HealeWidth /c, .Hea 1, .          th /c, .HealeWidth /c, .Hea 1     LineTo .hdc, .t -eight - Hei2o .hdc,aleWidth /c, .Hea 1     LineTo .hdc, .t -eight - Hei2o .hdc,aleWidth /c, .Hea 1     LineTo .hdc, .t -eight - Hei2o .hdc,aleWidth /c, .Hea 1     LineTo .hdc, .t -eight - Hei2o .hdc,aleWidth /c, .Hea 1     LineT CaseLrc .1
  2258.             1
  2259.                     .F                  rc .1
  2260.             1
  2261.                     .F         eTohA PL                     ycaleHes
  2262.           4, .S  3
  2263.  _3n1BDR_VISUAL2
  2264.   YYYYYlse
  2265.            lor =0So                  /va     YYlse
  2266.            lor =0So                  /va(Bd m        lor =0So  .hdc, .t -eight - Hei2o .hdc,, 2, Lines
  2267.     k         ines
  2268.  mond >> Draw Visn(1).X = .ScaleP               o .hdc, 1, .ScaleHei   MoveToEx .hdc    LineTo Lines
  2269.     k         ines
  2270.  mond >> Draw Visn(1).X = .ScaleP         i   MoveERs
  2271.  mond >> Draw Visn(1).X = .ScTo .hdc, .ScaleWidth - 3, .ScaolcaleHeight - 1
  2272.         P(1Dale  (ERs
  2273.  mond >> DrawForeC                         '>> Topht - 3
  2274.               DineTo .hdc, .ScaleWidth / 2, LineTo .hdc, 3,s ,hdc, .ScaleWidth               o .hdc, 1, .ScalealeHeigdc, 1, .ScaleHei   Mov1DineTo .hdc, .Sca  k                 3Feight - Hei2o .hdc,, 2, Lines
  2275.     k         ines
  2276.  mond >> Draw Visn(1).X = .ScaleP          p    .F         eTohA PL                     ycow2   YYYYC   e              oiangle >> Make Top_Triangle Shape.
  2277.     hRgn =   th /c, .Heahdc,, 2, Lines
  2278.     k         ines
  2279.  mond >> Draw Vc    LineTo Lines
  2280.     k   aines
  2281.     k   aines
  2282.    l  Line       I - 3
  2283.                 Else
  2284.              1eight - 2  oiangle >> Make Top_T mButtonStTLidth=caleWidth - 10, .ScaleHeight - 2, .ScaleWidth -
  2285.                      Height /             .ForeColo        3c, 1, .S0         lor =0So()
  2286.                      Height /             DineTo .hdc, .Scaop_T mButtonSt YYYYn      He.Fx&onSt 
  2287.                     .F         eTohA PL                     ycaleHes
  2288.           4, .S  3
  2289.  _3n1BDR_VISUAL2
  2290.   YYYY           Aies
  2291.  c,aleWi               .ForeColor = BDR_VISUAL1
  2292.                     MoveToEx .hdc, 1, .ScaleHeight - 2, Lines
  2293.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 2
  2294.                     LineTo .hdc, .ScaleWidth / 2, 3
  2295.                     .ForeColor = xLUEX               Rdth / 2, .ScaleHeight - 2, y.hdc, 106idth - dth - 2  4al1ght /va                     2, .ScaleHeight - 2, y.hdineTo .h     '>> Diamond >> Dr6ScaleWidth - 4, .ScaleHeight - 3, 2, 3, .ScaleWidth - 2, 3
  2296.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2297.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 2, 2, 2, .ScaleWidth - 3, 3, 3, 3
  2298.                     .ForeColor = BDR_GOLDXP_LIGHT5- 3, 3, 3,ei- 2, 1, 1, .ScaleHeight - 2
  2299.                 End If
  2300.  (    .ForeColor = BDR_VISUAL1
  2301.                     MoveToEx .hdc, 1, .Sca >>        .ForeColor = BDR_GOLDXP_NORMAL1
  2302.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 4, 3, 3, .ScaleWidth - 2, 4
  2303.                     .ForeColor = BDR_GOLDXP_NORMAL2
  2304.                     Arc .hdc, 3, 3, .ScaleWidth - 4, .ScaleHeight - e 2, .ScaleWidt       /FiRMALleWidt       /FiRMALleWidt       /FiRMALleWi11      /FiRMALleWidgh  - 1, Lines
  2305.                     LineTo .hdc, .ScaleWidth - 2, .Sca(LFcaleHeight / 2
  2306.         LineTo .hdc, .ScaleWidth / 2, 0
  2307.         LineTo .hdc, 0, .ScaleHeight / 2
  2308.      70dEeight_GOLDXPoight - 1
  2309.         LineTo .hdc, .ScaleWidth / 2, 1
  2310.  
  2311.         Select Case mButtonStyle
  2312.             Case Is = V        LiCs0
  2313.      nbLDX.hdc,2     Li      Cat - 2, Lines
  2314.    n_T mButtonStTLidth=caler<              LineTo .hdc, .SWidgh  - e- 2, 1, 1, .ScaleHeigh
  2315.           Lid        w Visual Style.
  2316.                 If MouseDown Then
  2317.                     .ForeC.ForeColor = BDR_VISUAL1
  2318.                     MoveToEx .hdc, 1, .SIf     P(1Dale  (ERs
  2319. r     MoveToEx .hdc, 1, .SIf     P(1Dale  (ERs
  2320. r     
  2321.           Lic,, 2,   - eWidth - 2, 3
  2322.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2323.                 h - 2, .Sca(LFcaleHeight / 2
  2324.         LineTo .hdc, .SXP_LIGHT1
  2325.               2, 2, 2oA     YYy9- 4, .ScaleHeight - 4, 3ies
  2326.  c,aleWi      Be Is = V        LiCs0
  2327.      ULleWi11      /FiRMALleWidgh  - 1, Lines
  2328.                     LineTo .hdc,Sca(LFcaleHe 2, .Scale,aleH   LineTo ..Sc.HealeWidth /c2, .    Elssssssssssssss      LineTo .hdc, .ScaleWidth / 2, 3
  2329.                     .ForeColor =  End      MoveToExPExPExPExPExPExPExPExPExPExPExPExPExPxPExPolor = BDR_GOLD                .ForeColor = BDR_GOLDXP_LIGHT1
  2330.                 h - 2, .Sca(LFcaleHeight / 2
  2331.         LineTo .hdc, .SXP_LIGHT1
  2332.               2, 2, 2oA     YYy9- 4, .ScaleHeight - 4, 3ies
  2333.  c,aleWi      Be Is = V        LiCs0
  2334.      ULleWi11      /FiRMALleWid           .ForeColor = BDR_GOLDHeight -1&2, 3
  2335.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2336.             CPSc.Holo_GOLDXP_LIGHT1
  2337.    , 0, 8FBi .h: lLD    hdc, .ScaleWidth / 2, 3
  2338.                     .ForeColor =0ForeColo
  2339.               2,OBLineTo .hdc, .ScaleWidth - 2, .ScaleHeight /CH           .Fore  2,OBLineTo .hdc, .Sci    /CH      Bidth - 2, .ScaleHeight /CH           .For     eight /CH          Flat        , .ScaleHeight - 2, .........................................................................Flato .hdUA
  2340.    .t -eight - Height - 3
  2341.  ............2,OB .SIf     P(1D_GOLD                .ForeColor = BDR_GOLDXP_LIGHT1
  2342.                 h - 2, .Sca(LFcaleHeight / 2
  2343.      -or yH                            .ForeColor = BDR_GOLDXP_LIGHT1
  2344.       Bidth - 2, .ScaleHeight /CH           .For     eight /CH          Flat        , .ScaleHeight - 2, .........................................................................Flato .hdUA
  2345.    .t -eight - H= BDR_JAht - B                   LineT'..............., 2oA     YeColor = BDR_GOLDXP_LIGHT1
  2346.       BidA2JAVA2
  2347.          oreColor = BDR_VISUAL2
  2348.                     Mo
  2349.       BidA2JAVA2
  2350.          o      x, .ScalWi11                  If MouseDowcalD.................................Flato .hdUA
  2351.    .t -eight - H= BDR_JAht - B                   LineT'..............., 2oA     YeColor = BDR_GOLDXP_LIGHT1
  2352.       BidA2JAVA2
  2353.        ....., 2oA     YeColorP_LIGHT1       If MouseDown Then
  2354.                     .ForeColor = BDR_FLAT1
  2355.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  2356.                     LineTo .hdc, 0, .ScaleHeight / 2
  2357.                     LineTo .hdc, .ScaleWidth / 2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,h - 2,, Linesolor = BDR_G> Top_Triangle >>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9>9,,,,,,,,,,,,,,,,,,9dmM   8p Lines
  2358.   dc,  .ForeColor = BDR_FLAT2
  2359.                     Movee
  2360.                     LineTo .hdc, 0, .ScaleHeight / 2
  2361.                     LineTo .hdc, .ScaleWidth / 2,,,,,,,,,,,,,,,,,,,,,,,,,GOLDXP_LIGHT1
  2362.       BidA2JAVA2
  2363.          oreCo,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,                  6C                  0olor = BDR_GOLDXP_LIGHT1
  2364.                 h - 2, .Sca(LFcaleHeight / 2
  2365.      -or yH               .ight  Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 2
  2366.   LDXP_LIGHT1
  2367.       BidA2JAVA2
  2368.       LineTo .hdc, .ScaleWidth / 2,,,,,IGHTlgo .hdc, 0, .ScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeiScale.ForeColor = BDR_JAVA2iScale.ForeColor = BDR_J, 0, Linesf o yle.
  2369.                 I - 3
  2370.           leHeight - 5, .ScaleWidth - 5, .ScalenyCor =0ForeColo
  2371.              5, .Sca>9>9>9>9>9>9>ghScaleHeighScalolo
  2372.              5, .S2, idt       /FiRMALleWi11      /FiRMALleWidgh  - 1, Lines
  2373.   eCole()
  2374.                MALleWi11      /FiRMALleWidgh  - 1, Lines
  2375.   eCole()
  2376.                MALleWi11      /FiRMA.ScaleHec, 1B      Elssssss     -or yH                            .ForeColor = BDR_GOLDXP_LIGHT1
  2377.       Bidth - 2, .ScaleHeight /CH           .For     eight /CH    ., 2cBss
  2378.                     LineTo7 /FiRMALleWidgh  - 1, Lines
  2379.   eCoTy>> Diamond >> Dr6ScaleWidth - 4, .ScaleHeight - 3, 2, 3, .ScaleWidth - 2, 3
  2380.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2381.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 2,     Bidth - 2, .ScaleHeight /CH           .For     eight /CH    ., 2cBss
  2382.                     Lin  ElsVhMALleWidgh  - 1, Lines
  2383.   eCole()
  2384.                MALleWi11      /F         dBh / 2, 0, Lines
  2385.                     LineTo .hdc, 0, .Scale5caleHeight -Ex .eTo .hdc, .ineTohA PL(   eu, .Scale5caleHeic, .ineT        Linedth / 2, .ScohA Alo
  2386. eTo .hdc, .inealeHeighScaleHeighScaleHeighScaleHeighScaleHeighScaleHeigleHeic, .ineT        Linedth / 2, .ScohA Alo
  2387. eTo .hdc, .inealeHeigholor = BDR_      Li.ForeColor = BDR_GOLDXP_LIGHT1
  2388.                     Arc .hdcForeColor = BDR_J, 0, L              LineTo .hdc, 0, .Scale5caleHeight -Ex .eTo .hdc, .ineTohA PL(,,,,,ynht - 2
  2389.   (             MoeHeight -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           .For     eight /CH    ., 2cBss
  2390.                     Lin  ElsVh    V             MALleWi11      /F         dBh / 2, 0, Lines
  2391.       V   MoeHeight -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           .For   aleWid3, 2,        .For   aleWid3, 2,        .For   aleWid3, 2,        .For Wi11      /F          aleoA     aleHht /CH    .,ight - 2  o, .ScaleHeight - 2,     Bidth - 2, .ScaleHeightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScaleHeighteightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScaleHeighteightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScaleHeighteightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2, .Scal1_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2, .Scal1_JAV- 2, .ScaleHeight /CH       t - 2
  2392.   ghtht -E2_JAVAeTo .hdc      idth E       t      .ScaleHeen    idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2, .Scal1_JAVAeTo .hdc      idth - 2, .Scale      aleHeight - 3
  2393.        e  hdc                             3      MoeHeight -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CHaleHeighteightht -E2_Jhdc, .SWidgh  - e- 2,t_Jhdc, .SWidgh  - e- 2,t_Jhdc, .SWidgh  - e- 2, .ScaleHeitcBss
  2394.             ght /CH           idth - 2, .ScE .Sc         ih / 2, 2,h / 2, 0, Liaight            ycaleHes
  2395.       BDR_GOLDXP_LIGHT1
  2396.                 h - 2, .Sca(LFcaleHeight / 2
  2397.      osWTo .hdc, .t -eight -  3      MoeHeight -E2_,t/ 2
  2398.      osWTo .hdc, .t -eighteTo .hdc      idth - 2, .ScaleHeiPal1ght /va              .Sc         idth - 2, .Scal1_N           3      MoeHeight             Lin  ElsVhMAL  LL    3
  2399.  ight    3      MoeHs      Lin  ElsVhMAL  LL    3
  2400.  ight    3      MoeHs      Lin  ElsVhMAL  LL    3
  2401.  ight    3      MoeHs      Lin  ElsVhMAL  LL    3
  2402.  ight    3      MoeHs      Lin  ElsVhMAL  LL    3
  2403. 3      MoeHeight  s
  2404. r     MoveToEx .hdc, 1, .SIf     P(1Dale  (ERs
  2405. r     
  2406.           Lic,, 2,   - eWidth -C    .Sc         idth - 2, .Scal1_N           3      MoeHeight             Lin  ElsVhMAL  LL    3fin  Elssss         Lin  ElsVhMA61MS    =al1_N   2gLsOScaleWidth / 2, 2
  2407.                     .ForeColor 81sVhM0- 2,N  
  2408.                         MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2409.                         LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2410.                         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2411.                         LineTo .hdc, .ScaleWid              LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2412.                         LineTo .hdEr     eight /
  2413.                         LineTo .FEneTo eigh     .hdc,.ScaleWidYeeigh     .hdc,.ScaleWidYeeigh h - 2, .ScE .Sight - 2
  2414.                         LineTo .hdc, .Scalidghhhhhhhhm                   LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2415.                         LineTo .hdc, .ScaleWid              LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2416.                         LineTo .hdEr     eight /
  2417.                         LineTo .FighScaleHeio .hd                       LineTo Hei2o .hdc,, 2, Lines
  2418.     k         iid3, 2,        .For   aleWidgh  - e- 2, .ScaleHeitcBs5                  LineTo .hdc, 0, .Scale5caleHeight -Ex .eTo .hdc, .ineTohA P2        Ff
  2419.    lor =0SoD3 .h       Ff
  2420.    lor =0SoDs = Flat                                 '>> Diamond >> D  o .hdc,    w> D  o .hdc,SFB  Polygon .hdc, PL(0), &H4
  2421.                     '>> Return FocusRect For Good Show.
  2422.      MoeHs      Lin  El Show.
  2423.      Moe    D  
  2424.           Lin  El ShAColor                                                                                   = OverFlat  1        dc      idth - 2, .ScaleHeig.ScE .AleHe >> D  o .hdc,   w.
  2425.   D               / 2, 2                MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2426.                     LineTo .hdc, ToEx  = EpusRe                  naGer                   BF                                   w.
  2427.   D               / 2, 2                MoveToEx .hdc, .ScaleWidth / 2, 1, L    r 2, 2                MoveToEx .hdc, .ScaleWidth / 2, 1, L    r 2, 2          nDhdc, .S  t      .ScaleHeen    idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2, .Scal1_JAVAeTo .hdc      idth - 2, .Scale      aleHeight - 3
  2428.        e  hdc                             3      MoeHeight -E2_JA  3      MoeHeight -E2_JA  3      MoeHeight -E2_JA  333333333333333333Height -E2L,,,,,,,,,,,,,,,,,,,,,,,,    oeHeo              MoveToEx .hdoEx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  2429.                     LineTo .hdc, .w
  2430.       GLineTo .hdc, .w
  2431.       ScE .Sigh,,,,,,,,,,,,,,,,,,,,,GOLDXP_LIGHT1
  2432.       BidA2JAVA2
  2433.          oreCo,,=eTo .hhhhhhhhhhhhhh LDXP_LIGHT1
  2434.       BidA2JAVA2
  2435.       LineTo .hdc, .ScaleWidth / 2,,0      t,VA2
  2436.       LineTocale      ScE eTo .hdc, .Scal     3c, 1, .S0  leWidth - 2, .ScaleHeight / 2, Lines
  2437.                     LineTo .hdc, .lt -E2_JA          s    o          LineTo .hdc, .lt -E2_JA C22_JA          s    o          Lin -E2_JA  o         To .hdcC22_JA ElsVhMA61MS    =al1_N   2Line       h - 10, .ScalleHeight /CHaleHeighteightht FB  Polygon .hdc, PL(0), &H4
  2438.                     '>> Return FocusReTsi  idth hdc, .F               c, PL(0),sReTsi  idth hdc, .F               c, PL(0eReTsi  idth hdc, .F               c, 7              c, PL(0eReTsi  idthohdc, PL(0), &H4       c, PL(0eReTsi  idthohdc, PL(0), &H4       c, PL(0eReTsi  idthohdc, PL(0), &H4ReTsith / 2, o .hdI  c, PeMove Then
  2439.                     .ForeColor = BDR_FLAT2
  2440.                     MoveToEF       alid)L(0), &H4
  2441.               MoveToEF       alid)L(0), &H4
  2442. Dolo
  2443.     leWi0i/ 2    MoveToEF       alid)L(0), &H4
  2444. Dolo
  2445.     leWi0i/ 2    MoveToEF       alid)L(06F               c, PL(0),sReTsi  idth hdc, .F               c, PL(0eReTsi  idtB           c, PL(      P_LIGHT1
  2446.                     1111111111111111111111111111111111111111111111111111111111111111111111111a(0), &H4
  2447.         .For  Polygc, .ScaleWidth -'>,   111D.Sca(LFcaleHeight 
  2448.         .FoFcaleHeight 
  2449.         .FoFcaleHeight 
  2450.         .FoFcaleHeight 
  2451. iCcaleHeight 
  2452. iCcaleHeight 
  2453. iCcaleeHeight 
  2454. iCcaleeHeight 
  2455. iCcaleeHeight 
  2456. iCcaeHeight 
  2457. iCcaleeHeight 
  2458. iCcaleeHei    = OverFlat  1        dc      idth - 2, .Sl               '>> Diamond >> Draw Xp Focu.ScaleWidth -'>,   111D.Sca(LFcaleHeei/ 2            3  eu, .Scale5caeHeight 
  2459. iCcaleeHeight 
  2460. iCcaleeHei    = OverFlaY, PL(0eReTsi  id 0)L(06F               c, PL(0),sReTsi  i   c, PL(0eReTsi  idth hdc, .F               c, 7              c, PL(0eReTsi  idthohdc, PL(0), &H4       c, PL(0eReTsi  idth dth - 2  4al1ght /va                e            oiangle wm                  .ForeColor = BDR_GOLDXP_LIGHT1
  2461.    iCcaleeHeight 
  2462. iCcaeHeight 
  2463. iCcaleeHeight 
  2464. iCcaleeHei    = OverFlaeHeight 
  2465. iCcaeHeight 
  2466. iCcaleeHeight 
  2467. iCcaleeHei    = OverFlaeHeight 
  2468. iCcaeHeight 
  2469. iCcaleeHeiolaeHe /va        , .ScaleWidth - 2, .ScaleHeight / 2
  2470.                         LineTo .hdc, .ScaleWid              LineTo .hdc, .ScaleWidth - 2, .ScaleH.hdlXp FocusRect.
  2471.               caleWidth - 2, .E  LineTo 2    MoveToEHeight 
  2472. iCcaleeHei    = Over&eight -E2_JAOver&eight -E2_JAS2, .ScaleHeight / 2
  2473.       ight 
  2474. paleHeighteightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .SsRectidth - 2, .ScaleHeigVAeTo .hdc      idth - 2, .ScaleHeight /Cght -Ex .eTo 4/aleHlTo .hdc, .lt -E2_JA          s    o       r7ScaleWidth / 2, 2, LDEe  y   5, .Sca>9>9>Lth - 2, .Scad    c, 7      _    ight 
  2475. paleHeighteightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .SsRectidth - 2, .ScaleHeigVAeTo .hdc      idth - 2, .ScaleHeight /Cght -Ex .eTo 4/aleHlTo .hdc, .lt -E2_JA          s    o       r7ScaleWidth / 2, 2, LDEe c, .ScaleWidth - 2, .Scae c, .ScaleWidth - 2, .Scae c, .ScaleWidth - 2, .Scae c, .ScaleWidth - 2, .Scae c, .ScaleWidth - 2, .Scae c, .ScaleWidth - 2, .Scae c, .Scac, LineTo .hdc, .ScaleScE 1e c, .ScaleWidth - 2, .Scae c, .Scac, LineTo .hdc, .ScaleCx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  2476.                     Line        thohdc, PL(0), &H4  e c, .ScaleWidth - 2, .Scae c, .Scat -E2_JA          s    o           _    ight 
  2477. paFWidth / 2, 2, LDEe  AVAeTo .hdc         c, PL111111111111111111eleHeigVAeTo .hdc      idth - 2, .ScaleHeight /Cght -Ex .eTo 4/aleHlTo 1111111111111111111111111111111111111a(0), leHeigVAeTo .hdc      idth - 2, .ScaleHeight /Cght -Ex .eTo 4/aleHlTo 1111111111111111111111ot /CH leeHeight 
  2478. iCcaleeHeight 
  2479. iCcaleeHeight 
  2480. iCcaeHeight 
  2481. iCcaleeHeight 
  2482. iCcaleeHei    = OverFlaeigh lo 2, .ScaleHeight /Cght -Ex .eTo 4/lLDEe  AVAeTo .hdc         c, PL111111111111111111eleHeigVpDLUEXP_DA= Ove,D    .eTo 4/aEXP_DA= Ove,D    .eTo 4/aEXP_DA= Ove,l11                  If MouseDowcalD.................................FlaleeHeigeHe  AVAeTo .hdc         c, PL111111111111111111  .eTo 4/aEXP_DA= Ove,D a 2, 3
  2483.  
  2484. paleHeighteig01111  .eTo .hdc         c,aleHeighteig01111.hdc         c,aleHeighteig01111.hdc         c,aleHeighteig01111.hdc         c r          If MouseDowcalD............co0Polygon .hdc, PL(0), &H4
  2485.                     '>> Rets  idth - 2, .ScaleHeight /CH           idth - 2H  p FocusRect.
  2486.                 11 .ScaleWidth / 2,,,,,,,,,,,,,,,,,,,,,,,,,GOLDXP_LeleHeight 
  2487.     ve,D      MoeHeight  s
  2488. r     MoveToEx         LineTo . / 2, 3x .l pHeight 
  2489. ightht -E2_JAVAeTo .hdc      idth LL   PL(0), &H4       c, PL(0eR  PL(0), &H4      th - B1sD    .eTo 4/aEXP_DA= Ove,l), &H4      th - B1sD    .eTo 4/aeoipeig01111  .eTo .hdc         c,aleHeighteig011ScaleWidth / 2, 1
  2490.  
  2491.         Select Case mButtonStyle
  2492.             Case Is = Visual                               '>> Top_Triangle >> Draw Visual Sty            3
  2493.   lo 2, .Sca 0idth /  - 2, .S oleHeTo2, .S oleHeTo2, .S oleHeTo2,       onStidth /  - 2, .S oleHeTo2, .S oleHeTo2, .S oleHeTo2,       onStidth /  - 2, .Sl               '>> Diamond >> Draw Xp Focu.ScaleWidth -'>,   111D.Sca(LFcaleHeei/ 2              MoveToEx eHeT, mBueTo>> Draw Xp Focu.ScaleWidth -'>,   111D.Sca(LFcaleHeei/ 2              MoveToEx eHeT, mBuBeTo .hdc, .ScaleWidth / 2, 3
  2494.   JAVAeTo .hdc      idth - 2, .ScaleHeight /CH        AeTo .hdc      idth - 2, .ScaleHeight /CH        AeTo .hdc      idth -AVAeTo .hdc       "12, .ScaleHeight /Cght -Ex .eTo 4/aleHlTo .hdc, .lt -E2_JA          s    o       r7ScaleWidth..........                    ight 
  2495.     ve,D      MoeHeight  s
  2496. r     MoveToEx        MoeHe11D.Sca(LFcaleHeei/ 2              MoveToEx eHeT, mBuBeT      Lid        w Visual Style.
  2497.                 If MouseDown Then
  2498.                  AC      AC              s    o          Lin N> Diamond >> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6Scal> Dr6SceeHei
  2499. L   PL(0), &H4               caleWidth - 2, .E  LineTo 2    MoveToEHeight 
  2500. iCcaleeHei    = Over&eight -E2_JAOver&eight -E2_JAS2, .ScaleHeight / 2
  2501.       ight 
  2502. paleHeighteightht -E2_JAVAeTo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .SsRectidth - 2, .ScaleHeigerTo .hdc         c, PL111cE .SsRectidth - 2            s   nStidth /  - 2, .Sl               '>> Diamond >> Draw Xp Focu.ScaleWidth -'>,   111D.Sca(LFcaleHeei/ 2              Move  .eTdth / 2, 1, L    r 2ocu.ScaleWidth -'> End With
  2503. End Sub
  2504. Private Sub RedrawH.eTdth / 2, 1, L  o .hdc                                     = OverFlat  1        dc      idth - 2, .ScaleHeig.ScE .AleHe >> D  o .hdc,  L         Scar6Scal> Dr6SceeHei
  2505. L   PL(0), &H4 D.eTohdc,  L         Scar6Scal> Dr6SceeHh                          w.
  2506.   D            h11111 Lines
  2507.   eCeHeen    DHOEhdco1 Li7Width -HhVpeig01111  .eTo ....................................7Width -Hht -E2_JAOver&eight -E2_JAS2, .ScaleHeight / 2
  2508.       ight 
  2509. paleHeighteightht           MoveToEx .hdc, .ScaleWidth / 2, 0, Linhhhhhhhhhh LDXP_LIGHT1
  2510.       BidA2JAVA2
  2511.       LineTo .hdc, .ScaleWidth / 2,,0      t,VA2
  2512.       LineTocale      ScE eTo .hdc, .Scal     3c, 1, .S0  leWidth - 2, .ScaleHeight / 2, Lines
  2513.          / 2, Lines
  2514.          / 2, Lines
  2515.  < .SIf     P(1Dal
  2516.        = OverFlaeigh lo 2,2BHeig.S                    .ForeColor = BDR_GOLDXP_NORMAL2
  2517.                    1BDR_GOLDXP_NORMAL2
  2518.          ht -E2_JAOLDH        AeTo .hdc      idth -m    B 2, .ScaleHeight  Li  1BDR_GOLDXP_NORaleHeigerTo .hdc         c, PL111cE .SsReL.............., 2oA   nLt 
  2519.     ve,D      MoeDXP_NORaleHeigerTo .hdc      ei/ 2   iRMA.ScaleHec, 1B      Elssssss     -or yH                            .ForeColor = gineTo .hdc, .ScaleCx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  2520.                     Line   &To .hdc      ei/ 2   iRMA.ScrliC iRMA.Scrliec, 1B      Elssssss     -or yH                            ., 1B      Elssssss     -or yH                      Elssssss  Linesolt -E2_JAOver&eight -E2_JAS2, .ScaleHeight / 2
  2521.       ight 
  2522. paleHeighteightht           MoveToEx .hdc, .ScaleWidth / 2, 0, Linhhhhhhhhhh LDXP_LIGHT1
  2523.       BidA2JAVA2
  2524.       LineTo .hdc, .ScaleWidth / 2,,0      t,VA2
  2525.       LineTocale      ScE eTo .hdc, .ScalsueWidth / 2, 0, Linhhhhhhhhh
  2526.     t           MoveToEx   LineTo .hdc, .ScaleWidth / 2,dth - 2,    MoveToEx .hdc, .ScaleWidth /  2, .ScohA Alo
  2527. eTo .hdc, .inealeHeigholor = BDR .ScaleWth / 2,,0      tWth ,,,,,GOLDXF .hdoERMA.Scrliec, 1B      Elsssss
  2528. ,07Xrliec, 1B      Elsssss
  2529. ,0tidth - 2, .ScaleHeigVAeTo .hdc     Elsssss
  2530. ,07Xrliec, 1B      Elsssss
  2531. ,0tidth - 2, .ScaleHeigVAeTo .hdc     Elsssss
  2532. ,07Xrliec, 1B      Elsssss
  2533. ,0tidth - 2, .ScaleHe'_LIG        4 FeBidA2JAVA2
  2534.       LineTo .hdc, .ScaleWidth / 2,,0      t,VA2
  2535.       LineTocale      ScE eTo .hdc, .ScalsueWidth / 2, 0, Linhhhhhhhhh
  2536.     t    eTo .hdc     Elsssss
  2537. ,07Xrliec, 1B      Elsssss
  2538. ,0tidth - 2, .ScaleHeigV0or mlD..........................._GOLDXP_NneTo .helsssss
  2539. ,NneTo BeeHeight 
  2540. iCcaleeHei    = OverFlaY, PL(0eReTsi  id 0)L(06F               c, PL(0),sReTsi  i   c, PL(0eReTsi  idth hdc, .F     .hdc, holor , Linhhhhhhhhh
  2541.     t    eTo .hdc     Elsssss
  2542. ,0<2LineTo .hdc, .S  Elsss
  2543. ,N>6peiiiiiiiiiiiiiiiiiiiiii6pe   yD .Scaless
  2544. ,0tidth - 2, .ScaleHeigV0or mlD..........................._GOLDXP_NneTo .helsssss
  2545. ,NneTo BeeHeight 
  2546. iCcaleeHei    = OverFlaY, PL( -E2_JAS2, .ScaleHeightHec, .STdth - 2, .=........................rwL.......................hhhhhhhhHT1
  2547.       BidA2JAVA2
  2548.       LineTo .hdc, .ScaleWidth / 2,,0      t,VA2
  2549.       Lin- 2, LinhhhhhVA2
  2550.       LineTo .hdc, .ScaleWid/CH           .FsR   caleWidth - 2, .Scae c, .ScaleWidineTo .hdc, .ScaleWid/CH           .FsR   caleWidth - 2, .Scae c, .ScaleWidi 
  2551. iCcaleeHeight 
  2552. iCcaleeHei    = eeeeeeeeee     idth - 2, .ScaleHeight /CH           .For     eight /CH    ., 2  idth hdc, .F     .hdc, hW.h - 2, .ScaleWidth - 2, .Scae c, .ScaleWidi 
  2553. iCcaleeHeight 
  2554. iCcaleeHei    = eeeeeeeeee     idth - 2, .ScaleHeight /CH           .For     eight /CH    ., 2  idth hdc, .F     .hdc, hW.h - 2, .ScanScanScanScanScanScanScanScanScanScanSiii6pe   yD .Scaaaaaaaaaa8ht /
  2555.  aaaaaaP
  2556. ,07Xrliec, 1B    .S  ElE iRMA.Sdi 
  2557. iCcaleeHeight 
  2558. iCS /va        , .ScaleWidth - 2, .ScaleHeight / 2
  2559.             eToEx eHeT, mBueTo>> Draw Xp Focu.Sca   .hdc, holor , LinhhhhhhhhhaleWidineTo .hdc, .ScaleW  5, .S2, idt       /FiRMALleWi11      /FiRMALleWidgh  - 1, Lines
  2560.   eCol,- 4, .Sh - 2, .ScaleHei/
  2561.  aaaaaaP
  2562. ,07Xrliec, h  - 1, Lines
  2563.    - 1, Lines
  2564.   eCol,-y/
  2565.  aaaaaaP
  2566. ,07XrlicanSaaaaP
  2567. ,07Xrliec, h  - 1, Lines
  2568.    - 1, Lines
  2569.   eCol,-y/
  2570.  aaaaaaP
  2571. ,07Xrli,2eCocanSaaaaP
  2572. ,07Xrliec, Lines.Scal        0CY4ITHTl.S2, idl  FFFFFFFFFFFFTop_o.Y = 8o                c      idth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleHeigmth - 2, .ScaleeHe2, .ScaleHeight /Bss
  2573. ,IFaleHeigml, .ScaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiV- 2, .ScaleoEx         LineTo . / 2, 3x .l pHeight 
  2574. ightht -E2_JAVAeTo .hdc      idth LL   PL(0), &H4       c, PL(0eR  PL(0.hdc, .ScaleWidth6ineseDXaleWt  =PY, PL(0eReTsi  id 0)L(06F             AcalsueWidth / 2, 0, Linhhhhhhhhh
  2575.     t   ehdc, .F     .hdc, holor , Linhhhhhhhhh31BhF .ScE .Sc         i.hdc, .ScaleWidth / 2, 3
  2576.   JAVAeTo .hdc      idth - 2, .ScaleHeight /CH    eight /CH 3
  2577.  ighdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdg10(hhhhaleWidineTo .hdc          d          m                   LineTo .hdghdghdgo d                             d                                   
  2578.                     LTo .hdc      idt      LTo .hdc      idt      LTo .hdc      idt      LTo .hdc )   eWidth - 2, .E  LineTo 2    MoveToEHeight 
  2579. iCcaleeHei    = Over&eight -Et    Fl.Bght 
  2580. iCcaleeHei    = Ov   '>> Diamond >> D  o .hdc,    w> D  o .hdc,S Linht -    d          m                   LineTooLineTo .Sca(LFcal1             i1pyEleHeen    i          i1pyEleHe  - 1, Lines
  2581.   eCol,-y/
  2582.  aaaaaaP
  2583. ,07XrlicanSaaaaP
  2584. ,07Xrliec, h  - 1, Lines
  2585.    - 1, Lines
  2586.   eCol,-y/
  2587.  aaaaaaP
  2588. n    i  , Lines.Scal        0CY4ITHTl.S2, idl  FFFFFFFFAb         c, es   Oo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2,MdMh hdc, .F     .hdc, hScaiiiiiiiiiiiiiiiiiiiiiiiiiiiiiV- 2, .ScaleoEx         LineTo . / 2, 3x .l pHeight 
  2589. ightht -E2_JAVAeTo .hdc      idth LL   PL(0), &H4       c, PL(0eR  PL(0.hdc, .(DXP_LIGHT1
  2590.       BidA2JAVA2
  2591.       LineTo .hdc, rliec, 1B      Elsssss
  2592. ,07Xrliec, 1B      DTo 2    Mo0s.Scal        0CY4ITHTl.S2, idl  FFFFFFFFAb         c, es   Oo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2,MdMh hdc, .F     .hdc, hScaiiiiiiiiiiiiiiiiiiit      LTo .hdc )   eWidth - 2, .E  LineTo 2    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 L    3
  2593.  ight  2, 2, LDEe c, .ScaleWidth - 2, .Scae c, .ScaleWidth -/ 2,P_NORMAL2
  2594.       5 2    Mo0s.Scal        0CY4ITHTl.S2, idl  FFFFFFFleHeight / 2
  2595.       ight 
  2596. paleHe
  2597. ,0tidth - 2, .ScaleHe'_LIG        4 FeBidA2JAVA2
  2598.       LineTo .hdc, .ScaleWidth CgT
  2599.  a     4 FeBidA2JAVA2
  2600.       LineTo .hdc, .ScaleWidth CgT
  2601.  a     4 FeBidA2JAVA2
  2602.       LineTo .hdc, .ScaleWidth CgT
  2603.  a     4 FeBiahMScaleWidth CgT
  2604.  a     4 FeBiahMI.ScaleHeight /CH     Cs...7Width -Hht -E2_JAOver&eight -E2_JAS2, .ScaleHeight / 2
  2605.       ight 
  2606. paleB1=idA2JAVA2
  2607.       Li     Vlllllllllllllllllll   c,   VlllmIi.hdc, .ScaleWidth CgT
  2608.  a     4 FeBidA2JAVA2) 4 FeBidsReTsi  i   c, PL(0eReTsi  idth hdc, .F     .hdc, holor , Linhhhhhhhhh
  2609.     t    eTo .hdc     El5B' d                             .h - 23 .ScaleHe'_LIG        4 FeBidA2JAVA2
  2610.                    .h - 23 .ScaleHe'_LIG     :L(0es:dg10(hhhhaleWidineTo .hdc          d          m                   LineTo .hdgh PL(0.hdc, .(DXP_LIGHT1
  2611.     cale2_JAOver&eight -eeeeeeeeeeeeeeeElsssss
  2612. ,07Xrliec, 1B      DTo 2    Mo0s.Scal        0CY4ITHTl.S2,    f,2    Mo0s.t /B2iiiiiiiiiiii)ITHTl.S2,    f,2iiiiiiiiii)ITHT .ScaleCx .hdc, .ScaleWidth - 2, .Scal2_JAOver&eight -E2_JAS2, .ScChdc-E2_JAS2, .ScChdc-E2_JAt / 2,,0      t,VA2
  2613.       LineTocale   E2_JAS2, .ScChdc-E2_,    f,2iiiiiiiiii)ITHT                       <wP 2:dg1eTo  Oo .hdc      idth - 2, .ScaleHeight /CH   J .hdc      idth - 2, .ScaleHeight /CH   J .hdc      idth - 2, .ScaleHeight /CH   J .hdc      idth - 2, .Scaler.0CY4ITHTl.S2, idl  FFFFFFFFAb         c, es   Oo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .Sc         idth - 2,MdMh hdc, .F     .hdc, hScaiA 2, .ScaleHeight /CH   J .hdc   SE_
  2614.     t    eTo .hdc     Elsssss
  2615.   o .hdc,S Linht -    d          m              SAFFle= BD11111111111111111111      MoveToEx               .hdc, hScaiA 2, .ScaleHeight /CH   J .hdc   SE_
  2616.     t    eTo .hdc - 2, . SE_
  2617.     t   t    eTo .hdc     Elsssss
  2618.   o .hdc,S Linht -    d          m         c .Scae c, .Scale)    Mov  eTo .hdc     EF38leWidth - 2, .Scal2_JAOver&eight -E2_JAS2, .ScChdc-E2_JAS2, .ScChdc-E2_JAt / 2,,0      t,VA2  LineTo .n                Movehdc     El5B' dC0), &H4  eF THT .ScaleCx .hdc, .o .hdc     0Fe THT .ScaleCx .hdc  eFVo .hdc, .ScaleWid    MoeDXP_NORaleHeigerTo .hdc      ei/ 2  th6inesd   o .hdc      ei/ 2      Moe3Lines
  2619.    - 1, Lines
  2620.   eCol,-y/
  2621.  aaC2dth -      d          m         oo  Elssssadth - 2, .Scal1_JAVAeTo .hdc , es  H  - 2, .S oleHeTo2, .S oleHeTo2,leeHei4  H  -, .ScaleWidth /  2, .ScohA Alo
  2622. eTo .hdc, .inealeHeigholor = BDR .ScaleWth / 2,,wmC   Movehdc     El5B' dC0), &H4  eF THTveToEx eHeT, mBuBeT      Lid        w Visual Style.
  2623.        111111111mBuBeT      Lid        w Visual Style.
  2624.        111111111mBuBeT      Lid        w=, .Sca,eTo oEx .hdc,      ci10, 0, Lines
  2625.           dth / 2, .ScaleHeight - 2, Lines
  2626.    0-Ex .HmIi. =ht -E2_JAVAeTo .hdc      idth LL Lines
  2627.    0-Ex .HmIi. =ht -E2_JAVAeTo .hdc      idth LL LiVt.hdc     Linto .hdc                  x .hdc, .o .hdc     hXc   cal     3c, 1, .S0  leWidth - 2, .ScaleHeight / 2, Lines
  2628.        anSaaaaP
  2629. ,07Xrliec, h  - s.Scah&1, LiiiiiiiiiiiiiiiiSaaaaP
  2630. ,07Xrliec, h  - s.Scah&1, LiiiiiiiiiiiiiiiiSaaaaP
  2631. ,07Xrliec, h  - s.Scah&1, LiiiiiiiiiiiiiiiiSaaaaEx .3
  2632. ,0<2LineTo .hdc, .S  ge   hXc   cal     3c, 1, .S0  leWidth - 2, .ScaleHeight / 2, Lines
  2633.        anSaaaaP
  2634. ,07Xrliec, h  - s.Scah&1, Liiiiiiiiiical eHec, 1B      Elssssss     -or yH                       1" 1B      ElssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssMo0s.2pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppdc, .ineTohA P2        Ffpppppppp6Scal> Dr6Scal> Dr6Scal> DPppppppppppppppppppsssssssssssssssssssssssssssssssssssMo0s.2pppppppppppppppppppppppppppppppppppppppsssssss,Ei.hdc, hScaiA 2, .ScaleHeight /CH   J .hdc   SE_
  2635.     t    eTo .hdc     Elsssss
  2636.   o .hdc,S Linht<2LineTo .hdc, .S  ge   hXc   cal     3c, 1, .S0  leWidth - 2, .ScaleHeight / 2, Lines
  2637.        anSaaaaP
  2638. ,0ScaleHeigVAeTo .hdc     Elsssss
  2639. ,07Xrliec, 1B      Elsssss
  2640. ,0tidth - 2, .ScaleHe'_LIG        4L, 1B     ,,  FfppFd              Lineighdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdghdg10(hhhhaleWidint 
  2641. iCcaleeHeiineTo .dghdghdg .S0  leWidth - 2, .ScaleHeight / 2, Lines
  2642.        anSaaa- 2,ScaleHeightneTo .dghdghdg .A          .F                  rc .1
  2643.             1
  2644.                i1mBuBeT      Lid   ealeHeusssssss
  2645.       ight 
  2646. paleHe
  2647. ,0tidth - 2, .Sd   ealeHc       2222222222222222222, &Hdghdgh5NgLinht<2LineTo .hdc, .Sssssss  .Ss0Fa.Sd   ealeHc       2222222222222222222, &.hdc      idth LL   PL(0), &H4       c, PL(0eRp 2oA   nL2o .hdc, .ScaleWid    MoeDXP_NORaleHeigerTo .hdc    .hdc, .ScaleWidth / 2eight /wc, .ScaleWidth / 2enssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssoc.ScaleI    3c, 'LL   PL(0), &H4       c, PL(0eR2_JAt / 2,,0      t,VA2
  2648.   ssssssss, .ScaleWid    MoeDXP_NORaleHeigerTo .hdc    .hdc, .ScaleWidth / 2eight /wc, .ScaleWidth / 2ensssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss .hdc    .hdc,VVP .ScaleWidth / 2, 3
  2649.   JAVAe6      anSaaaaP
  2650. ,00      t,VA2
  2651.   ssssssss, .ScaleWid    MoeDXP_NanSaaaaP
  2652. ,00      t,VA2
  2653.   ssHoeDX/CH           .For     eight /CH    ., 2  idssssssssssssssssssssssssssssssssssssssssssssoc.ScaleI    3c, 'LL lsc,S Linht<2LineTo .hdc, .S  ge   hXc   c  i1mBuBeT      Lid   ealeHeusssssssidint CnUCt -E2_JAS2, .ScaleHeight / 2
  2654.   .ScaleWid   HmIght 
  2655. iCcaleeHei    = eeeeeeeeee     i)F   eight /CH    ., 2  idsssssssssssssssssssssssssssssssssnT             eTo .hdc, .Sca       aaaaP) o .hdc, .Scassssss  t,VA2
  2656.     / 2ensssssssssssssssssssssss     2,           ,VA2
  2657.   B     anSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS7Xrliec, Lines.Scal        0CY4ITHTl.S2, idl  FFFFFFFFAb         c, es   Oo .hdc      idth - 2, .ScaleHeight /CH           idth - 2, .ScE .          s    o       r7ScaleWidth..........                    ight 
  2658.  LinE       = Over&eight -Et    Fl.Bght 
  2659. iCcaleeHei    = Ov   '>> Diamond >> D  o .hdc,    w> D  o .hdc,S Linht -    d          m                   LineTooLineTo .Sca(LFcal1             i1pyEleHeen    i          i1pyEleHe  - 1, Lines
  2660.   eCol,-y/
  2661.  aaaaaaP
  2662. ,07XrlicanSS idthV ssssssssssssssssssssssssssssth -'> End With
  2663. End Sub
  2664. Private Sub RedrawH.eTdth / 2,      - 6Scal> Dr6Scal> Dr6Scal> DPppppppppppppppppppsss Sub
  2665. Privat.ScaleWidYeeigh h - 2, .ScE .Sight - 2
  2666.                         LineTo .hdc, .Scali        b    a    11  .eTo .hdc         c,aleHeighteig011Scht 
  2667.  LinE       = O - 2
  2668.                         LineTo .hdc, O - 2
  2669.        2
  2670.       LineTo .hdc, rliec, 1B   .ScE .Sight - 2
  2671.                         LineTo .hdc, .Scali        b    a    11  .eTo .hdc         c,aleHeighteig011Scht 
  2672.  LinE       = O - 2
  2673.                         LineTo .hdc, O - 2
  2674.       idth - 2, .ScE .          s    o       r7ScaleWid  0CY4ITHTl.S2, idl  FFFFFFFFFFFFhdc, O - 2
  2675.       idth - 2, .ScE . 22, &.hdc      idth LL   PL(0), &H4       c, PL(0eRp 2oA   nL2o .hdc, .Scal
  2676. A    LineTo .hdc, .Scali        b          Line 22, &.hdc .ScC    Cp5dghdghdg .S0  lexrCeWidYeeigh h - 2, .ScE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mal2_eHeight / 2, Lines
  2677.        anSaaFFFhdccal
  2678. A   lLDEe  AVAP
  2679. ,07Xrliec, h  - 1, Lines
  2680.    - 1, Lines
  2681.    - 1, Lines
  2682.    - 1, LineXP_Le
  2683. aP
  2684. ,0F.hdc, .Scali        b    a    11  .eTo .hdc ig0R/ 2,LineXP_Le
  2685. aP
  2686. ,0 LinE       = Over&eight -Et    Fl.BR/ i       idth - 2, .ScE .Sc         ih / 2, 2,h 7To .hdc   .ScEe-   ih / 2, 2,h 7To .hdc   .ScEe--   ihhhhh 2,h32Height /eTo .h0.mDTFmh 7To .hdc   .ScEe--   ihhhhh 2,.hdc   .ScE  .ScEe--   h0.mD = Over&eight -Et    Fl.BR/ >> DcEe--   h0.mD = OvleWt  =PY, PL(0eReTsi  id 0)L(06F             AcalsueWidth / 2, 0, Linhhhhhhhhh
  2687.     t   ehdc, .F     .hdc, holor , Linhhhhhhhhh31BhF .ScE .Sc         i.hd0)L,   - 1, Lines
  2688.   eC1111  .ee6Scal> DPpppppF, Lines
  2689.   .ight  Arc .hdcL(0eReT- 1, Lines
  2690.   eCol,-y/
  2691.  aaaaaaP
  2692. ,07XrlicanSS idthV ssssssssssssssssssssssssssssth -'> End With
  2693. End Sub
  2694. Private Sub RedrawH.eTdt.hdc    tPrivate Sub RedrawH.eTdt.hdc    tPrivate Sub RedrawH.eTd.hd0)L,   - 1, Lines
  2695.   eC1111  .ee6Scal> DPpppc    tPrivate Sub RedrawH.eTd.hd0)L,  .eTdt.hdc    tPrivate Sub ReDssssssssssssth -'> End With
  2696. End Sub
  2697. PrivaCmh 7To .hdc   .ScEe--   ihhhhh 2 With
  2698. End S, Linhhhhhhhhh
  2699.     trrivaCmh 7To .hdc   .ScEe--     w=, .Sca,eTo oEx .hdc,      .111111111-'> End With
  2700. End Subh, .S oleHeTo2,leeHei4  H  -, .ScaleWidth /  2, .ScohA Alo
  2701. eTo .hdc, .inealeHeigholor = BDR .Scaleve    thohdc, PL(0), &H4ReTsith / 2, o .hhhhhhhhaleWidineTo .hdc, .ScaleW  5, .S2, idt       /Y  ssHoeDX/CH       t2, 3, .ScalmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .mcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mal2_eHeig(BmDTFmcE .Si0.mDTFmc.A8aLsHOo .hdc      idth - 2,CDTFmcE .mcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFmcE .Si0.mDTFo-i0.m 8End With
  2702. End Sub
  2703. PrivaCmh 7TohF .ScE .Sc         i.hd0)L,   - 1,PtColor = BDR_J, 0, Linesf o yle.
  2704.                 Iight -E2_JAS2, .ScChdc-E2_JAS2, .ScChdc-E2_JAt / 2,,0      t,VA 2,,0      t,VA 2,,0      tdF)TE2_JAS2, .ScChdc-E2_JAt / 2,,0    5MV 8   1,VA2
  2705.   ssssssss, .=ee-E2_JAt / 2,,0    5MV 8   1,VA2V 8   1,VA2
  2706. &,
  2707.     trrivaCmh 7To .hdc   .ScEe--     w=, .Sca,eTo oEx .hdc,      .111111Ro oEx .hdc.hdc,   V 8   1,VA2
  2708.    - 1, LineXP_Le
  2709. aP
  2710. ,0F.hdc, .Scali        b    Xa .Scali        b    Xa         2,OBLineTo .hdc, .ScaleWidth - 2, .Scald0)L,   - 1,PtColoXa         2E_
  2711.     t   t    eTo .hdc    idth - 2, .Scal1_N           3      MoeHelEx .HmIi. =ht -Et    eTo .hdc     ElssssBcEe--   h0.mD = Ovee.
  2712.   Ii. =   - ,PtColoXa         2E_
  2713.     t   t    eTo r,NneTo BeeHeight 
  2714. iCcaleeHei    = OverFlaY, PL(0eReTsi  id 0)L(06F               c, PL(0),sReTsi  i   c, PL(0eReTsi  idth hdc, .F     .hdc, holor , Linhhhhhhhhh
  2715.     t    eTo .hdc    (   Fl.BR .hdc   .ScEe--     w=, .Sca,eToeF)77si              x .hdc, .o .hdc     hXc   cal     3c, 1, .S0     .ScEe--   ihhhhh 2,.hdc   .ScE  .ScEe--   h0.mD = Over&eigh   , .F     .hdc, holor , Linhhhhhhhhh
  2716.     t    eTo .FmcE .Si0.mDo .hdc    (   Fl.BR .hdc   .ScEe--     w=, .Sca,fT5 
  2717. iCcaleeHei    = OverFlaY, PL(0eReTsi  id  cal     3c, 1, .S0     .ScEe--   ihhhhh 2,.hdc   .ScE  .ScEe--   h0.mD = Over&eigh   , .F     .hdc, holor , Linhhhh ig0R/ 2,LineXP_Le
  2718. aP
  2719. ,0 LinE       = Over&eight -Et    Fl.BR/ i       idthrFlaY, PL(0eReTsi  id  cal - 2, .SNGT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTTT .S0     .Sc)i.Ee-   ih / 2, 2,h 7To .hdc   .ScEe--  im            AcalsuAV 8   1,VA2
  2720.   ssssssss, .=ee-E2_JAt / 2,,0    5MV 8   1,VA2V 8   1,VA2
  2721. ineF     .hdc, h_es    t,VA 2, .SNGTTTTTTTTTTTTTTTTTc, holor , Li,uH 1, Lines
  2722.    - 1, Lines
  2723.   eCol,-y/
  2724.  aaaaaaP
  2725. ,07Xrli,2e     MoeHeight -E2_JA  333333333333333333Height -E2L,,,,,,,,,,,,,,,,,,,,,,,,                        w  33333333/ 2,LineXP_Le
  2726. aP
  2727. ,0 LinE   P_Le
  2728. aP
  2729. ,0 LinE   P_Le
  2730. aP
  2731. ,0 LinE   P_Le
  2732. aP
  2733. ,0 LinE   P_Le
  2734. aP
  2735. ,0 LinE   P_Le
  2736. aP
  2737. ,0 LinE   P_Le
  2738. aP
  2739. ,0 LinE   P_L   P_sssshdc   .ScLe
  2740. aP
  2741. ,0 LinE   3Height -E= OverFlaeHeight 
  2742. iCcaeHeight 
  2743. iCcaleeHeissss
  2744. iCcaeHeight 
  2745. iCcaleeHeissss
  2746. iCcaeHeight 
  2747. iCcaleeHeissss
  2748. iCcaeHeight 
  2749. iCcaleeHeissss
  2750. iCcaeHeight 
  2751. iCcaleeHeissss
  2752. iCcaeHeight 
  2753. iCcaleeHeissss
  2754. iCcaeHeight 
  2755. iCcaleeHeissss
  2756. iCcaeHeight 
  2757. iCcaleeHeissss
  2758. iCcaeHeight 
  2759. iCcaleeHbD .hdc, hol/CH     Cs...7WiA   t    eTo .hdc     Elsssss
  2760. dc    (   Fl.BR .0      BidA2JAVA2
  2761.       LineTo .hdc, .ScaleWidth / 2,,0      t,V   , .F     .hElssDl.BR .0      BidA2JAVA2
  2762.   e.BR .0      BidA2JAVA2
  2763.   e.BR .0      BidA2leeHbD .hdc, hol/CH     Cs...7WiA   t    eTo .hdc     Elsssss
  2764. dc    (   Fl.BR .0     .hdc, hW.h - 2, . Fl.BR .0     eighs...    .hdc,
  2765. iCcaeHeig2_JAOver&eight -eeeeeeeeeeeeeeeElsssss
  2766. ,07Xrliec, 1B      DTo 2    Mo0s.Scal /yElsssssssssssdl  FFFFFFFFAb         c, es   O2,,0      t,VA2  LineTo .n                Movehdc    .ScaleWidth / 2, 3
  2767.   JAV   1,VA2
  2768.    - 1, Line6,,,,,,,,,,,,,,,,,,Width / 2,,0      t,V   , .F     .hElssDl.BR .0      BidA2JAVA2
  2769.   e.BR .0      BidA2JAVA2
  2770.   e.m3t,V   , .F  AVA2seeHbD .hdchh ig0R/ 2,LineXP_Le
  2771. aP
  2772. ,0 LinE       = Over&eight -Et    Fl.BR/ i       idthrFlaY, PL(0eReTsi  id  cal - 2, .SNGT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTTT .S0     .Sc)i.Ee-   ih / 23SNGT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTTT .S0     .Sc)i.Ee-   ih / 23SNGT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTTT .S0     .Sc)i.Ee-   ih / 23SNGT1   A 2,,0      t,VA 2, .St/ 2, 3
  2773.   JAV   1,VA2
  2774.    - 1, Lin        5MV 8   1tid  cal - 2, .SNGT1   A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTTT .S0   dc      idth - 2, .ScaleJAV   1,VA2
  2775.    - 1, Lin        5MV 8   1tid  cal -  m       tl    t,V   , .F     .hElssDl.BR .0      BidA2JAVA2
  2776.   e.BR .0      BidA2JAVA2
  2777.   e.BR .0      BidA2leeHbD .hdc, hol/CH     Cs...7WiA   t    eTo .hdc     Elsssss
  2778. dc    (   Fl.BR .0     .hdc, hW.h - 2, . Fl.BR .0     eighs...    .hdc,
  2779. iCcaeHeL(0eR2_JAt / 2,,0      t,VA2
  2780.   ssssssss, .ScaleWid    MoeDXP_NORaleHeigerTo .hdc    .hdc, .ScaleWidth / 2eight /wc, .ScaleWidth / 2enssssssssssssssssssss0    5MV 8   1,VA2V 8  o .hdc    .hdc, .ScaleWidth / 2eight /wc, .ScaleWidth / 2enssssssssssssssssssss0    5MV 8   1,VA2V 8  o .hdc    .hdc, .ScaleWidth / 2eight /wc, .ScaleWidth / 2enssssssssssssssssssss0    5MV 8   1,VA2V 8  o .hdc    .hdc, .ScaleWidth / 2eight /ht 
  2781. paleHHHHHHXeeeeElsssss
  2782. ,07Xrliec, 1B     Hsssssssss0   Ee-   ih / 23S   ih / t / 2, Lines
  2783.        anSaaFFFhdccal
  2784. A   lLDEe  AVAP
  2785. ,07Xrliec, h  - 1A  "22
  2786.       LineTo  .ScaleWidth / 2eight /ht FFFFFFFhdghdghdghdghdghdg10(hhhhaleWGHT1
  2787.                     1111111111111111111111111111111111111110FFFFFhdghdghdghdghdg"iiiiiiiiiSaaaaP
  2788. ,07Xrliec, h  - s.Scah&1, LiiiiiiiiiiiiiiiiSaaaaP
  2789. ,07XrliecA.ScaleWidth / 2   D  
  2790.           Lin  El ShAColor                                     P
  2791. ,0 LinE   3Height -E= OverFlaeHeigh                      P
  2792. ,0 LinE   3Heigh0      BidA2JAVA2
  2793.   e.BR .0      BidA2leeH3eHeissss
  2794. iCcaeHeight 
  2795. iCcaleeHeissss
  2796. iCcaeHeight 
  2797. iCcHgh0      By 8   1,VA2V 8  o .hdc 1dth - 2, .ScaleJAV  d
  2798. ,0 LinE   3Heigh0      BidA2JAVA2
  2799.   e.BR .0      BidA2leeH3eHeissss
  2800. iCcaeHeight 
  2801. iCcaleeHeissss
  2802. t eissss
  2803. iCclSaaFFFhdccal
  2804. A   lLDEe  AVAP
  2805. ,07Xrliec, h  - 1A  "22
  2806.       LineTo  eHeissss9,sss
  2807. t eissss
  2808. iCclSaaFFFhdccal: Ib,sss Ys     ght /CH           idth - 2, .ScE .Sc         ih / 2, 2,h / 2, 0, Liaight            .Sca AVA2seeHbD .hdchh ig0R/ 2,LineXP_Le
  2809. aP
  2810. ,0 LinE       = Over&eight -Et,h / 2, 0, Liaight            .Sca AVA2seeHbD .hdchh ig0R/ 2,LineXP_Le
  2811. aP
  2812. ,0 LinE       = Oveight 
  2813. i    .Sca AVA2seeHbD .hdchh ig0R/ 2,LineXP_Le
  2814. aP
  2815. ,0 LinE       = Oveight 
  2816. i    .Sca AVA2seeHbD .hdchh ig0R/ 2,LineXP_Lte3issss
  2817. iCcaeHeight 
  2818. iCcaleeHeissss
  2819. iCcaeHeight 
  2820. iCcaledA2leeH3eHeissss
  2821. iCcaeH7CcaeHeight 
  2822. iCcaledA2leeH3eHeissss
  2823. iCcaeH7eHeissss
  2824. iCcaeH7Ccadth - 2,MdMh hdc, .F     .hdc,  A 2,,0      t,VA 2, .SNGTTTTTTTTTTTTTTTTTTTTTTTTTTTT .S0  LA 2,iCcaledA2leeH3eHeissAp,  A 2,,0     TTTTTeHeissss
  2825. iCcaeH7Ccadth -     TTTTTeHeissss
  2826. iCcaeH -     TTTTTeHeissss
  2827. iCca 1B     Hsssssssss0   Ee-   ih / 23S   ih / t / 2, Lines
  2828.        anSaaFFFhdccalTTTTdccalTTTTdccalTTTTdccalTTTTdccalTTTTdccaiiiiiiiiiiiiiiiiiiiiiiiiiiiii23S      = Oveight 
  2829. i    .Sca AVA2seeHbD .hdchh ig0R/ 2,LineXP_Le
  2830. aP
  2831. ,0 LinE      TTTTTeHeissss
  2832. iCca 1B     Hsssssssss0   Ee-   ih / 23S   ih / t / 2, Lines
  2833.      aP
  2834. ,0 LinE      TT 23oih /